Increase telemetry queue size (#3802)

Joseph T. Lyons created

It seems like we've fixed the clickhouse errors by switching to
`async_insert`, but we're still seeing a hiccup here and there on
vercel's socket. I slowed down the collection of cpu and memory events
earlier, and this PR will slow down how frequently we send events in
general, by increasing the queue size and the debounce time.

Release Notes:

- N/A

Change summary

crates/client/src/telemetry.rs  | 4 ++--
crates/client2/src/telemetry.rs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

Detailed changes

crates/client/src/telemetry.rs 🔗

@@ -119,13 +119,13 @@ pub enum ClickhouseEvent {
 const MAX_QUEUE_LEN: usize = 1;
 
 #[cfg(not(debug_assertions))]
-const MAX_QUEUE_LEN: usize = 10;
+const MAX_QUEUE_LEN: usize = 50;
 
 #[cfg(debug_assertions)]
 const DEBOUNCE_INTERVAL: Duration = Duration::from_secs(1);
 
 #[cfg(not(debug_assertions))]
-const DEBOUNCE_INTERVAL: Duration = Duration::from_secs(30);
+const DEBOUNCE_INTERVAL: Duration = Duration::from_secs(120);
 
 impl Telemetry {
     pub fn new(client: Arc<dyn HttpClient>, cx: &AppContext) -> Arc<Self> {

crates/client2/src/telemetry.rs 🔗

@@ -118,13 +118,13 @@ pub enum ClickhouseEvent {
 const MAX_QUEUE_LEN: usize = 1;
 
 #[cfg(not(debug_assertions))]
-const MAX_QUEUE_LEN: usize = 10;
+const MAX_QUEUE_LEN: usize = 50;
 
 #[cfg(debug_assertions)]
 const DEBOUNCE_INTERVAL: Duration = Duration::from_secs(1);
 
 #[cfg(not(debug_assertions))]
-const DEBOUNCE_INTERVAL: Duration = Duration::from_secs(30);
+const DEBOUNCE_INTERVAL: Duration = Duration::from_secs(120);
 
 impl Telemetry {
     pub fn new(client: Arc<dyn HttpClient>, cx: &mut AppContext) -> Arc<Self> {