pub struct BenchmarkGate { /* private fields */ }Expand description
Benchmark gate that compares measurements against thresholds.
Implementations§
Source§impl BenchmarkGate
impl BenchmarkGate
Sourcepub fn load_json(gate_name: &str, json: &str) -> Option<Self>
pub fn load_json(gate_name: &str, json: &str) -> Option<Self>
Load thresholds from a simple JSON map.
Expected format:
{
"metric_name": { "budget": 123.0, "tolerance_pct": 10.0 }
}Returns None if parsing fails.
Sourcepub fn load_baseline_json(
gate_name: &str,
json: &str,
percentile: &str,
) -> Option<Self>
pub fn load_baseline_json( gate_name: &str, json: &str, percentile: &str, ) -> Option<Self>
Load thresholds from FrankenTUI’s tests/baseline.json format.
This format uses percentile budgets (p99_ns) and threshold_pct:
{
"frame_render": {
"p99_ns": 2000000,
"threshold_pct": 10
}
}Entries whose keys start with _ are skipped (metadata comments).
The percentile parameter selects which budget to use (e.g., "p99_ns").
Returns None if the JSON is malformed.
Sourcepub fn evaluate(&self, measurements: &[Measurement]) -> GateResult
pub fn evaluate(&self, measurements: &[Measurement]) -> GateResult
Evaluate measurements against thresholds.
Metrics with no matching threshold get MetricVerdict::Unchecked.
Emits structured JSONL evidence via TestJsonlLogger.
Trait Implementations§
Source§impl Clone for BenchmarkGate
impl Clone for BenchmarkGate
Source§fn clone(&self) -> BenchmarkGate
fn clone(&self) -> BenchmarkGate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BenchmarkGate
impl RefUnwindSafe for BenchmarkGate
impl Send for BenchmarkGate
impl Sync for BenchmarkGate
impl Unpin for BenchmarkGate
impl UnsafeUnpin for BenchmarkGate
impl UnwindSafe for BenchmarkGate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more