pub struct RunReportParams<'a> {
pub stats: &'a RunStats,
pub reservoir_size: usize,
pub run_start: Instant,
}Expand description
Parameters required to build a RunReport from a completed RunStats.
reservoir_size and run_start are not stored on RunStats (they are inputs
to the run, not results). They are threaded through here to avoid polluting
the core run type with output-layer concerns.
§Invariant
run_start must be the Instant captured immediately before the first
request was dispatched, so that completed_at - run_start correctly maps
each result to its stage window.
Fields§
§stats: &'a RunStats§reservoir_size: usizeConfigured reservoir cap (--result-buffer). Passed from CLI args.
run_start: InstantWall-clock instant at which the run started (before first request fired).
Why this field exists beyond the original spec: per_stage_reports buckets
each RequestResult into a stage window by computing
completed_at.checked_duration_since(run_start) and comparing it against the
cumulative [stage_start, stage_end) offsets. Without this anchor, wall-clock
timestamps cannot be mapped to stage windows.
Why from_params (fixed mode) accepts it but discards it: API uniformity.
Both fixed and curve callers construct a single RunReportParams and pass it to
from_params or from_params_with_curve without needing to know which variant
requires run_start. Keeping one param struct prevents callers from branching on
mode before building params.