Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Jan 25, 2025
1 parent 8b27f62 commit 6277708
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions crates/fluvio-benchmark/src/stats_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ impl StatCollector {
record_bytes: 0,
latency: 0,
};
let mut window = 0;
let mut latencies_histogram =
hdrhistogram::Histogram::<u64>::new(3).expect("new histogram");

Expand All @@ -236,7 +235,7 @@ impl StatCollector {
central_stats.latency += stats.latency;
latencies_histogram.record(stats.latency).expect("record");

if elapsed.as_secs() >= 1 {
if elapsed.as_secs() >= 5 {
let latency_avg = latencies_histogram.mean() as u64;
let latency_max = latencies_histogram.value_at_quantile(1.0);
let records_per_sec =
Expand All @@ -263,35 +262,11 @@ impl StatCollector {
};
latencies_histogram =
hdrhistogram::Histogram::<u64>::new(3).expect("new histogram");
window += 1;
}
}
}
_ = end_broadcast.recv() => {
if window == 0 {
break;
}

let latency_avg = latencies_histogram.mean() as u64;
let latency_max = latencies_histogram.value_at_quantile(1.0);
let elapsed = instant.elapsed();
let elapsed_seconds = elapsed.as_millis() as f64 / 1000.0;
let records_per_sec =
(central_stats.record_send as f64 / elapsed_seconds).round() as u64;
let bytes_per_sec =
(central_stats.record_bytes as f64 / elapsed_seconds).round() as u64;

let _ = stats_sender
.send(Stats {
record_send: central_stats.record_send,
record_bytes: central_stats.record_bytes,
records_per_sec,
bytes_per_sec,
latency_avg,
latency_max,
})
.await;
break;
break
}
}
}
Expand Down

0 comments on commit 6277708

Please sign in to comment.