udp load test: rename config key peer_histogram to extra_statistics

This commit is contained in:
Joakim Frostegård 2024-02-06 18:52:12 +01:00
parent c97a3a7996
commit b16ab82699
3 changed files with 6 additions and 6 deletions

View file

@ -25,8 +25,8 @@ pub struct Config {
/// ///
/// 0 = include whole run /// 0 = include whole run
pub summarize_last: usize, pub summarize_last: usize,
/// Display data on number of peers per info hash /// Display extra statistics
pub peer_histogram: bool, pub extra_statistics: bool,
pub network: NetworkConfig, pub network: NetworkConfig,
pub requests: RequestConfig, pub requests: RequestConfig,
#[cfg(feature = "cpu-pinning")] #[cfg(feature = "cpu-pinning")]
@ -41,7 +41,7 @@ impl Default for Config {
workers: 1, workers: 1,
duration: 0, duration: 0,
summarize_last: 0, summarize_last: 0,
peer_histogram: true, extra_statistics: true,
network: NetworkConfig::default(), network: NetworkConfig::default(),
requests: RequestConfig::default(), requests: RequestConfig::default(),
#[cfg(feature = "cpu-pinning")] #[cfg(feature = "cpu-pinning")]

View file

@ -113,7 +113,7 @@ fn monitor_statistics(
thread::sleep(Duration::from_secs(INTERVAL)); thread::sleep(Duration::from_secs(INTERVAL));
let mut opt_responses_per_info_hash: Option<IndexMap<usize, u64>> = let mut opt_responses_per_info_hash: Option<IndexMap<usize, u64>> =
config.peer_histogram.then_some(Default::default()); config.extra_statistics.then_some(Default::default());
for message in statistics_receiver.try_iter() { for message in statistics_receiver.try_iter() {
match message { match message {
@ -239,7 +239,7 @@ fn create_peers(config: &Config, info_hash_dist: &InfoHashDist) -> Vec<Box<[Peer
let mut rng = SmallRng::seed_from_u64(0xc3a58be617b3acce); let mut rng = SmallRng::seed_from_u64(0xc3a58be617b3acce);
let mut opt_peers_per_info_hash: Option<IndexMap<usize, u64>> = let mut opt_peers_per_info_hash: Option<IndexMap<usize, u64>> =
config.peer_histogram.then_some(IndexMap::default()); config.extra_statistics.then_some(IndexMap::default());
let mut all_peers = repeat_with(|| { let mut all_peers = repeat_with(|| {
let num_scrape_indices = rng.gen_range(1..config.requests.scrape_max_torrents + 1); let num_scrape_indices = rng.gen_range(1..config.requests.scrape_max_torrents + 1);

View file

@ -353,7 +353,7 @@ impl Worker {
.response_peers .response_peers
.fetch_add(self.statistics.response_peers, Ordering::Relaxed); .fetch_add(self.statistics.response_peers, Ordering::Relaxed);
if self.config.peer_histogram { if self.config.extra_statistics {
let message = StatisticsMessage::ResponsesPerInfoHash( let message = StatisticsMessage::ResponsesPerInfoHash(
self.announce_responses_per_info_hash.split_off(0), self.announce_responses_per_info_hash.split_off(0),
); );