Skip to content

Commit

Permalink
latencies should be in microseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
brayniac committed Oct 15, 2023
1 parent 7c83892 commit c7808b7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ fn client_stats(snapshot: &mut MetricsSnapshot, elapsed: f64) {

let mut latencies = "Client Response Latency (us):".to_owned();

for (label, _percentile, value) in response_latency {
latencies.push_str(&format!(" {label}: {value}"))
for (label, _percentile, nanoseconds) in response_latency {
let microseconds = nanoseconds / 1000;
latencies.push_str(&format!(" {label}: {microseconds}"))
}

output!("{latencies}");
Expand Down Expand Up @@ -195,16 +196,18 @@ fn pubsub_stats(snapshot: &mut MetricsSnapshot, elapsed: f64) {

let mut latencies = "Pubsub Publish Latency (us):".to_owned();

for (label, _percentile, value) in pubsub_publish_latency {
latencies.push_str(&format!(" {label}: {value}"))
for (label, _percentile, nanoseconds) in pubsub_publish_latency {
let microseconds = nanoseconds / 1000;
latencies.push_str(&format!(" {label}: {microseconds}"))
}

output!("{latencies}");

let mut latencies = "Pubsub End-to-End Latency (us):".to_owned();

for (label, _percentile, value) in pubsub_latency {
latencies.push_str(&format!(" {label}: {value}"))
for (label, _percentile, nanoseconds) in pubsub_latency {
let microseconds = nanoseconds / 1000;
latencies.push_str(&format!(" {label}: {microseconds}"))
}

output!("{latencies}");
Expand Down

0 comments on commit c7808b7

Please sign in to comment.