pub struct LatencyReport {
pub query_count: usize,
pub mean_us: f64,
pub min_us: f64,
pub max_us: f64,
pub p50_us: f64,
pub p95_us: f64,
pub p99_us: f64,
pub qps: f64,
}Expand description
Summary of a per-query latency measurement.
All latency values are reported in microseconds. Percentiles use
the nearest-rank method: for a sorted (ascending) sample of n
values, p_q is the value at index clamp(ceil(q × n) − 1, 0, n − 1).
This matches Criterion and hdrhistogram defaults — every reported
percentile is an observed latency, never an interpolation.
qps is single-threaded throughput derived as
query_count / sum_of_latencies_seconds. Warm-up samples are excluded
from every field.
§Examples
use iqdb_eval::LatencyReport;
let r = LatencyReport {
query_count: 1_000,
mean_us: 250.0, min_us: 100.0, max_us: 900.0,
p50_us: 220.0, p95_us: 600.0, p99_us: 850.0,
qps: 4_000.0,
};
assert!(r.p50_us <= r.p95_us);
assert!(r.p95_us <= r.p99_us);Fields§
§query_count: usizeThe number of queries the report was aggregated over (warm-up queries are not included).
mean_us: f64Arithmetic mean of per-query latency, in microseconds.
min_us: f64Smallest per-query latency observed, in microseconds.
max_us: f64Largest per-query latency observed, in microseconds.
p50_us: f6450th-percentile (median) per-query latency, in microseconds.
p95_us: f6495th-percentile per-query latency, in microseconds.
p99_us: f6499th-percentile per-query latency, in microseconds.
qps: f64Single-threaded throughput: query_count / total_latency_seconds.
Trait Implementations§
Source§impl Clone for LatencyReport
impl Clone for LatencyReport
Source§fn clone(&self) -> LatencyReport
fn clone(&self) -> LatencyReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LatencyReport
impl Debug for LatencyReport
Source§impl<'de> Deserialize<'de> for LatencyReport
impl<'de> Deserialize<'de> for LatencyReport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LatencyReport
impl PartialEq for LatencyReport
Source§fn eq(&self, other: &LatencyReport) -> bool
fn eq(&self, other: &LatencyReport) -> bool
self and other values to be equal, and is used by ==.