From 0a3698de0ff65d39c2105cc98a60a9f05d7c3935 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 21 Jul 2023 15:51:32 -0700 Subject: [PATCH] 30 seconds for tsdb everywhere --- web3_proxy/src/app/mod.rs | 2 +- web3_proxy/src/stats/stat_buffer.rs | 6 +++--- web3_proxy/src/sub_commands/migrate_stats_to_v2.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index 7ecc242e..b476e638 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -335,7 +335,7 @@ impl Web3ProxyApp { rpc_secret_key_cache.clone(), user_balance_cache.clone(), stat_buffer_shutdown_receiver, - 1, + 30, flush_stat_buffer_sender.clone(), flush_stat_buffer_receiver, )? { diff --git a/web3_proxy/src/stats/stat_buffer.rs b/web3_proxy/src/stats/stat_buffer.rs index 805666cd..4d106819 100644 --- a/web3_proxy/src/stats/stat_buffer.rs +++ b/web3_proxy/src/stats/stat_buffer.rs @@ -13,7 +13,7 @@ use migration::sea_orm::prelude::Decimal; use std::time::Duration; use tokio::sync::{broadcast, mpsc, oneshot}; use tokio::time::{interval, sleep}; -use tracing::{error, info, trace, warn, Instrument}; +use tracing::{debug, error, info, trace, warn, Instrument}; use ulid::Ulid; #[derive(Debug, Default)] @@ -144,7 +144,7 @@ impl StatBuffer { let (count, new_frontend_requests) = self.save_relational_stats().await; if count > 0 { db_frontend_requests += new_frontend_requests; - trace!("Saved {} stats for {} requests to the relational db", count, new_frontend_requests); + debug!("Saved {} stats for {} requests to the relational db", count, new_frontend_requests); } } _ = tsdb_save_interval.tick() => { @@ -152,7 +152,7 @@ impl StatBuffer { let (count, new_frontend_requests) = self.save_tsdb_stats().await; if count > 0 { tsdb_frontend_requests += new_frontend_requests; - trace!("Saved {} stats for {} requests to the tsdb", count, new_frontend_requests); + debug!("Saved {} stats for {} requests to the tsdb", count, new_frontend_requests); } } x = flush_receiver.recv() => { diff --git a/web3_proxy/src/sub_commands/migrate_stats_to_v2.rs b/web3_proxy/src/sub_commands/migrate_stats_to_v2.rs index 7c9640d6..45c4b270 100644 --- a/web3_proxy/src/sub_commands/migrate_stats_to_v2.rs +++ b/web3_proxy/src/sub_commands/migrate_stats_to_v2.rs @@ -82,13 +82,13 @@ impl MigrateStatsToV2SubCommand { let emitter_spawn = StatBuffer::try_spawn( BILLING_PERIOD_SECONDS, top_config.app.chain_id, - 30, + 60, top_config.app.influxdb_bucket.clone(), influxdb_client.clone(), rpc_secret_key_cache, user_balance_cache, rpc_account_shutdown_recevier, - 1, + 30, flush_sender, flush_receiver, )