ThresholdConfig class

Whether a threshold violation fails the benchmark or only warns (FR-005). Pass/fail criteria for a single metric (FR-005).

Constructors

ThresholdConfig({required String metric, required ThresholdOperator operator, required num value, ThresholdSeverity severity = ThresholdSeverity.error})
Creates a threshold configuration.
const
ThresholdConfig.fromJson(Map<String, dynamic> json)
Deserializes a threshold from its JSON representation, rejecting unknown operators and severities with a FormatException.
factory

Properties

expectation → String
Human-readable expectation, e.g. latency_p99 <= 40.
no setter
hashCode → int
The hash code for this object.
no setterinherited
metric → String
Name of the metric this threshold guards (e.g. latency_p99).
final
operator → ThresholdOperator
Comparison applied between the measured value and value.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
severity → ThresholdSeverity
Severity recorded when the threshold is violated.
final
value → num
The threshold value.
final

Methods

isViolatedBy(num actual) → bool
Returns true when actual violates this threshold.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes the threshold to a JSON-compatible map.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited