Skip to content

Commit

Permalink
Report latency distributions for each function separately
Browse files Browse the repository at this point in the history
  • Loading branch information
pkolaczk committed Aug 9, 2024
1 parent 05e72cc commit ea1a693
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,21 +719,30 @@ impl<'a> Display for BenchmarkCmp<'a> {
Percentile::Max,
];

writeln!(f)?;
writeln!(f, "{}", fmt_section_header("CYCLE LATENCY [ms]"))?;
if self.v2.is_some() {
writeln!(f, "{}", fmt_cmp_header(true))?;
}
for fn_name in self.v1.cycle_latency_by_fn.keys() {
writeln!(f)?;
writeln!(
f,
"{}",
fmt_section_header(format!("CYCLE LATENCY for {fn_name} [ms] ").as_str())
)?;
if self.v2.is_some() {
writeln!(f, "{}", fmt_cmp_header(true))?;
}

for p in resp_time_percentiles.iter() {
let l = self
.line(p.name(), "", |s| {
let rt = s.request_latency.as_ref().map(|rt| rt.percentiles.get(*p));
Quantity::from(rt).with_precision(3)
})
.with_orientation(-1)
.with_significance(self.cmp_resp_time_percentile(*p));
writeln!(f, "{l}")?;
for p in resp_time_percentiles.iter() {
let l = self
.line(p.name(), "", |s| {
let rt = s
.cycle_latency_by_fn
.get(fn_name)
.map(|l| l.percentiles.get(*p));
Quantity::from(rt).with_precision(3)
})
.with_orientation(-1)
.with_significance(self.cmp_resp_time_percentile(*p));
writeln!(f, "{l}")?;
}
}

if self.v1.error_count > 0 {
Expand Down

0 comments on commit ea1a693

Please sign in to comment.