Class BowireBenchmarkStats
- Namespace
- Kuestenlogik.Bowire.Benchmarking
- Assembly
- Kuestenlogik.Bowire.Benchmarking.dll
Aggregate latency statistics over one benchmark run (#360).
Percentiles use nearest-rank — ceil(p/100 × n) − 1 into the
sorted sample — which is the method the workbench's benchmark rail has
always used (_percentileSorted in benchmarks.js). Matching it
matters more than picking a "better" interpolation: an operator who sees
p95 = 142 ms in the rail and then gates CI on p95 < 150 must not
get a different number from the CLI for the same sample.
public sealed class BowireBenchmarkStats
- Inheritance
-
BowireBenchmarkStats
- Inherited Members
Properties
Avg
Arithmetic mean latency in milliseconds.
public double Avg { get; }
Property Value
Count
Number of completed calls the sample covers.
public int Count { get; }
Property Value
ErrorRate
Failed calls as a fraction of all calls (0..1) — k6's http_req_failed rate.
public double ErrorRate { get; }
Property Value
Errors
Calls that failed (transport error or error status).
public int Errors { get; }
Property Value
Max
Slowest observed latency in milliseconds.
public double Max { get; }
Property Value
Min
Fastest observed latency in milliseconds.
public double Min { get; }
Property Value
P50
Median latency in milliseconds.
public double P50 { get; }
Property Value
P90
90th-percentile latency in milliseconds.
public double P90 { get; }
Property Value
P95
95th-percentile latency in milliseconds.
public double P95 { get; }
Property Value
P99
99th-percentile latency in milliseconds.
public double P99 { get; }
Property Value
SortedLatencies
The sorted latency sample the percentiles were taken from.
public IReadOnlyList<double> SortedLatencies { get; }
Property Value
Throughput
Completed calls per second over the run's wall clock.
public double Throughput { get; }
Property Value
Methods
From(IEnumerable<double>, int, double)
Compute the statistics for a run. latenciesMs may
arrive in any order — it is sorted here, once, so every percentile
reads from the same canonical array.
public static BowireBenchmarkStats From(IEnumerable<double> latenciesMs, int errors, double elapsedSeconds)
Parameters
latenciesMsIEnumerable<double>Latency of each completed call, in milliseconds.
errorsintHow many calls failed.
elapsedSecondsdoubleWall-clock duration of the run, for throughput.
Returns
PercentileOfSorted(IReadOnlyList<double>, double)
Nearest-rank percentile over an already-sorted sample. Mirrors
_percentileSorted in the benchmark rail's JS, including the
empty-sample answer of 0 and the clamp at both ends.
public static double PercentileOfSorted(IReadOnlyList<double> sorted, double percentile)
Parameters
sortedIReadOnlyList<double>percentiledouble
Returns
Value(BowireBenchmarkMetric)
Read one metric by its BowireBenchmarkMetric id — the seam thresholds evaluate through, so adding a metric doesn't mean teaching the threshold evaluator about it separately.
public double Value(BowireBenchmarkMetric metric)
Parameters
metricBowireBenchmarkMetric