pub struct DetectionStats {
pub turns_analyzed: usize,
pub loops_detected: usize,
pub convergences_detected: usize,
pub current_streak: usize,
}Expand description
Cumulative statistics from the DetectionManager.
Returned by DetectionManager::stats for observability and
debugging. All counters are monotonically increasing within a session
(until DetectionManager::reset is called).
Clone and Default — can be cheaply snapshot
and serialised for logging or UI display.
§Example
let stats = dm.stats();
println!("Turns: {}", stats.turns_analyzed);
println!("Loops: {}", stats.loops_detected);
println!("Convergences: {}", stats.convergences_detected);
println!("Current streak: {}", stats.current_streak);§See Also
DetectionManager::stats— the accessor that returns snapshots of this type.DetectionManager::reset— zeroes all counters.
Fields§
§turns_analyzed: usizeTool-call operations recorded via record_operation. Reset by reset.
Total count of operations fed into the loop detector since the last
DetectionManager::reset, giving the denominator for loop-rate
calculations.
loops_detected: usizeSubset of turns_analyzed that returned LoopDetected. Reset by reset.
How many of the recorded operations resulted in a
DetectedPattern::LoopDetected verdict, so callers can gauge how
frequently the agent gets stuck in tool loops.
convergences_detected: usizeTimes record_response returned ConvergenceDetected. Reset by reset.
How many assistant responses triggered a
DetectedPattern::ConvergenceDetected verdict, indicating how often
the agent’s replies collapsed into repetition.
current_streak: usizeMirrors LoopStatus::repetition_count. Triggers LoopDetected at loop_threshold. Reset by reset.
Live snapshot of the most-repeated operation’s count, so observers can
watch a potential loop build up before it actually trips the
DetectionConfig::loop_threshold.
Trait Implementations§
Source§impl Clone for DetectionStats
impl Clone for DetectionStats
Source§fn clone(&self) -> DetectionStats
fn clone(&self) -> DetectionStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more