From 620f2d9d00099d918c917ade3d1411927a2210ff Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 21 Jul 2023 16:12:38 -0700 Subject: [PATCH] 30 second flushes for db too --- web3_proxy/src/app/mod.rs | 2 +- web3_proxy/src/stats/stat_buffer.rs | 2 +- web3_proxy/tests/test_users.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index b476e638..78ce9da0 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -329,7 +329,7 @@ impl Web3ProxyApp { let stat_sender = if let Some(spawned_stat_buffer) = StatBuffer::try_spawn( BILLING_PERIOD_SECONDS, top_config.app.chain_id, - 60, + 30, top_config.app.influxdb_bucket.clone(), influxdb_client.clone(), rpc_secret_key_cache.clone(), diff --git a/web3_proxy/src/stats/stat_buffer.rs b/web3_proxy/src/stats/stat_buffer.rs index 4d106819..28339a7a 100644 --- a/web3_proxy/src/stats/stat_buffer.rs +++ b/web3_proxy/src/stats/stat_buffer.rs @@ -441,7 +441,7 @@ impl StatBuffer { if count > 0 { // TODO: put max_batch_size in config? // TODO: i think the real limit is the byte size of the http request. so, a simple line count won't work very well - let max_batch_size = 100; + let max_batch_size = 1000; let mut num_left = count; diff --git a/web3_proxy/tests/test_users.rs b/web3_proxy/tests/test_users.rs index 46a0e99d..6f342e42 100644 --- a/web3_proxy/tests/test_users.rs +++ b/web3_proxy/tests/test_users.rs @@ -499,7 +499,7 @@ async fn test_referral_bonus_concurrent_referrer_only() { let number_requests = 100; // Spin up concurrent requests ... let mut handles = Vec::with_capacity(number_requests); - for _ in 1..number_requests { + for _ in 0..number_requests { let url = x.proxy_provider.url().clone(); let secret_key = rpc_keys.secret_key;