pagebench: fix percentiles reporting (#6547)

Before this patch, pagebench was always showing the same value.

refs https://github.com/neondatabase/neon/issues/6509
This commit is contained in:
Christian Schwarz
2024-02-01 00:29:48 +01:00
committed by GitHub
parent e82625b77d
commit 4c173456dc

View File

@@ -66,13 +66,10 @@ impl serde::Serialize for LatencyPercentiles {
{
use serde::ser::SerializeMap;
let mut ser = serializer.serialize_map(Some(LATENCY_PERCENTILES.len()))?;
for p in LATENCY_PERCENTILES {
for (p, v) in LATENCY_PERCENTILES.iter().zip(&self.latency_percentiles) {
ser.serialize_entry(
&format!("p{p}"),
&format!(
"{}",
&humantime::format_duration(self.latency_percentiles[0])
),
&format!("{}", humantime::format_duration(*v)),
)?;
}
ser.end()