Class BowireBenchmarkThreshold

Namespace
Kuestenlogik.Bowire.Benchmarking
Assembly
Kuestenlogik.Bowire.Benchmarking.dll

A latency / error / throughput budget a benchmark run must satisfy (#360) — k6's threshold concept, expressed the same way flow expectations are, so an operator learns one grammar.

Written as metric operator budget: p95 < 200, error-rate < 0.01, throughput >= 50. Whitespace is optional and k6's own p(95) spelling parses too, so a budget copied out of a k6 script keeps working.

public sealed class BowireBenchmarkThreshold
Inheritance
BowireBenchmarkThreshold
Inherited Members

Properties

Budget

The budget itself — milliseconds, a 0..1 rate, or calls/second.

public double Budget { get; }

Property Value

double

Metric

The metric under budget.

public BowireBenchmarkMetric Metric { get; }

Property Value

BowireBenchmarkMetric

Operator

How the measured value is compared to the budget.

public BowireThresholdOperator Operator { get; }

Property Value

BowireThresholdOperator

Source

The spec as the operator wrote it, for messages and the k6 export.

public string Source { get; }

Property Value

string

Methods

Evaluate(BowireBenchmarkStats)

Check the threshold against a run's statistics.

public BowireThresholdResult Evaluate(BowireBenchmarkStats stats)

Parameters

stats BowireBenchmarkStats

Returns

BowireThresholdResult

IsLatency(BowireBenchmarkMetric)

True when the metric is a latency in milliseconds (for formatting).

public static bool IsLatency(BowireBenchmarkMetric metric)

Parameters

metric BowireBenchmarkMetric

Returns

bool

MetricName(BowireBenchmarkMetric)

Wire / display name of a metric.

public static string MetricName(BowireBenchmarkMetric metric)

Parameters

metric BowireBenchmarkMetric

Returns

string

ToString()

The canonical spelling, used in the TTY summary and as the key in the k6-summary export (k6 keys thresholds by their source text).

public override string ToString()

Returns

string

TryParse(string?, out BowireBenchmarkThreshold?, out string?)

Parse a threshold spec. Returns false with a human-readable error rather than throwing: these come from a command line, so a typo deserves a usage message, not a stack trace.

public static bool TryParse(string? spec, out BowireBenchmarkThreshold? threshold, out string? error)

Parameters

spec string
threshold BowireBenchmarkThreshold
error string

Returns

bool