pub struct PredicateDebugReport {
pub total_candidates: usize,
pub matched: usize,
pub clause_stats: BTreeMap<String, ClauseStats>,
}Expand description
Aggregate report from running a Predicate across a corpus
of candidate evaluation contexts.
Phase 6 of CAPABILITY_ENHANCEMENTS_PLAN.md. Built by
PredicateDebugReport::from_evaluations.
The report answers: “given this predicate and these candidates, how many matched, and how often did each clause filter?”. A clause with 1042 evaluations and 12 matches has 1.2% positive selectivity — operators use that to spot mismatches between their mental model of the data and the actual data.
Fields§
§total_candidates: usizeNumber of candidates the predicate was evaluated against.
matched: usizeNumber of candidates the predicate matched (returned true).
clause_stats: BTreeMap<String, ClauseStats>Per-clause aggregated stats, keyed by the clause’s debug
label. BTreeMap for deterministic iteration order in
printed output.
Implementations§
Source§impl PredicateDebugReport
impl PredicateDebugReport
Sourcepub fn from_evaluations<'a, I>(pred: &Predicate, contexts: I) -> Selfwhere
I: IntoIterator<Item = EvalContext<'a>>,
pub fn from_evaluations<'a, I>(pred: &Predicate, contexts: I) -> Selfwhere
I: IntoIterator<Item = EvalContext<'a>>,
Run pred against each context in contexts, accumulating
per-clause hit / miss stats.
Each context contributes one trace; the trace tree is walked
post-order to update the per-label ClauseStats. Composite
clauses (And / Or / Not) get their own labels too, so an
operator can see “the And short-circuited 730/1042 times” at
a glance.
Trait Implementations§
Source§impl Clone for PredicateDebugReport
impl Clone for PredicateDebugReport
Source§fn clone(&self) -> PredicateDebugReport
fn clone(&self) -> PredicateDebugReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PredicateDebugReport
impl Debug for PredicateDebugReport
Source§impl Default for PredicateDebugReport
impl Default for PredicateDebugReport
Source§fn default() -> PredicateDebugReport
fn default() -> PredicateDebugReport
Source§impl PartialEq for PredicateDebugReport
impl PartialEq for PredicateDebugReport
Source§fn eq(&self, other: &PredicateDebugReport) -> bool
fn eq(&self, other: &PredicateDebugReport) -> bool
self and other values to be equal, and is used by ==.