Skip to main content

diagnose_traced

Function diagnose_traced 

Source
pub fn diagnose_traced(case: &Case) -> (Report, Vec<RuleTrace>)
Expand description

Same as diagnose but also returns a per-rule trace recording each rule’s wall-clock evaluation time and whether it fired.

Useful for --trace output and for benchmarking. Trace entries are returned in the order rules ran (the order from all_rules), not the order they appear in the report.

§Examples

use api_debug_lab::{diagnose_traced, Case};
use std::path::Path;

let case = Case::load("auth_missing", Path::new("fixtures"))?;
let (report, traces) = diagnose_traced(&case);
assert_eq!(traces.len(), 8); // one trace per rule
assert!(report.primary.is_some());