pub struct RuleProfile {
pub rule_id: u64,
pub rule_name: String,
pub invocations: u64,
pub successes: u64,
pub failures: u64,
pub total_time_us: u64,
pub min_time_us: u64,
pub max_time_us: u64,
}Expand description
Per-rule execution statistics.
Fields§
§rule_id: u64Stable numeric identifier for the rule.
rule_name: StringHuman-readable rule name.
invocations: u64Total number of times the rule was attempted.
successes: u64Number of times the rule fired and produced at least one binding.
failures: u64Number of times the rule was tried but did not match.
total_time_us: u64Cumulative wall-clock time spent in this rule (microseconds).
min_time_us: u64Minimum single-invocation time observed (microseconds).
max_time_us: u64Maximum single-invocation time observed (microseconds).
Implementations§
Source§impl RuleProfile
impl RuleProfile
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Fraction of invocations that resulted in a successful match.
Returns 0.0 when invocations == 0 (avoids division by zero).
Sourcepub fn avg_time_us(&self) -> f64
pub fn avg_time_us(&self) -> f64
Average time per invocation in microseconds.
Returns 0.0 when invocations == 0.
Sourcepub fn is_hotspot(&self, threshold_us: u64) -> bool
pub fn is_hotspot(&self, threshold_us: u64) -> bool
Returns true when the average invocation time exceeds threshold_us.
Trait Implementations§
Source§impl Clone for RuleProfile
impl Clone for RuleProfile
Source§fn clone(&self) -> RuleProfile
fn clone(&self) -> RuleProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RuleProfile
impl RefUnwindSafe for RuleProfile
impl Send for RuleProfile
impl Sync for RuleProfile
impl Unpin for RuleProfile
impl UnsafeUnpin for RuleProfile
impl UnwindSafe for RuleProfile
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more