From b16ab82699f71e71a33811b73bac3ca426eee02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Tue, 6 Feb 2024 18:52:12 +0100 Subject: [PATCH] udp load test: rename config key peer_histogram to extra_statistics --- crates/udp_load_test/src/config.rs | 6 +++--- crates/udp_load_test/src/lib.rs | 4 ++-- crates/udp_load_test/src/worker.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/udp_load_test/src/config.rs b/crates/udp_load_test/src/config.rs index 5f87318..27e7eb2 100644 --- a/crates/udp_load_test/src/config.rs +++ b/crates/udp_load_test/src/config.rs @@ -25,8 +25,8 @@ pub struct Config { /// /// 0 = include whole run pub summarize_last: usize, - /// Display data on number of peers per info hash - pub peer_histogram: bool, + /// Display extra statistics + pub extra_statistics: bool, pub network: NetworkConfig, pub requests: RequestConfig, #[cfg(feature = "cpu-pinning")] @@ -41,7 +41,7 @@ impl Default for Config { workers: 1, duration: 0, summarize_last: 0, - peer_histogram: true, + extra_statistics: true, network: NetworkConfig::default(), requests: RequestConfig::default(), #[cfg(feature = "cpu-pinning")] diff --git a/crates/udp_load_test/src/lib.rs b/crates/udp_load_test/src/lib.rs index cd0d2bf..fced2ca 100644 --- a/crates/udp_load_test/src/lib.rs +++ b/crates/udp_load_test/src/lib.rs @@ -113,7 +113,7 @@ fn monitor_statistics( thread::sleep(Duration::from_secs(INTERVAL)); let mut opt_responses_per_info_hash: Option> = - config.peer_histogram.then_some(Default::default()); + config.extra_statistics.then_some(Default::default()); for message in statistics_receiver.try_iter() { match message { @@ -239,7 +239,7 @@ fn create_peers(config: &Config, info_hash_dist: &InfoHashDist) -> Vec> = - config.peer_histogram.then_some(IndexMap::default()); + config.extra_statistics.then_some(IndexMap::default()); let mut all_peers = repeat_with(|| { let num_scrape_indices = rng.gen_range(1..config.requests.scrape_max_torrents + 1); diff --git a/crates/udp_load_test/src/worker.rs b/crates/udp_load_test/src/worker.rs index 0d8037c..570b1bb 100644 --- a/crates/udp_load_test/src/worker.rs +++ b/crates/udp_load_test/src/worker.rs @@ -353,7 +353,7 @@ impl Worker { .response_peers .fetch_add(self.statistics.response_peers, Ordering::Relaxed); - if self.config.peer_histogram { + if self.config.extra_statistics { let message = StatisticsMessage::ResponsesPerInfoHash( self.announce_responses_per_info_hash.split_off(0), );