pub trait MetricsCallback: Send + Sync {
// Required methods
fn record_hard_compaction(&self, turns_since_last: Option<u32>);
fn record_tool_output_prune(&self, count: usize);
fn record_compaction_probe_pass(
&self,
score: f32,
category_scores: Vec<CategoryScore>,
threshold: f32,
hard_fail_threshold: f32,
);
fn record_compaction_probe_soft_fail(
&self,
score: f32,
category_scores: Vec<CategoryScore>,
threshold: f32,
hard_fail_threshold: f32,
);
fn record_compaction_probe_hard_fail(
&self,
score: f32,
category_scores: Vec<CategoryScore>,
threshold: f32,
hard_fail_threshold: f32,
);
fn record_compaction_probe_error(&self);
}Expand description
Metrics-counter sink for ContextService increments.
Implemented in zeph-core by an adapter wrapping Arc<MetricsCollector>. Keeps
zeph-agent-context free of zeph-core internal metrics types. Closes #3527.
All four record_compaction_probe_* methods are called from inside the
CompactionProbeCallback implementation — not from the service itself — per the
probe-callback contract.
Required Methods§
Sourcefn record_hard_compaction(&self, turns_since_last: Option<u32>)
fn record_hard_compaction(&self, turns_since_last: Option<u32>)
Record that a hard-compaction event occurred.
turns_since_last is None on the first hard compaction of the session.
Sourcefn record_tool_output_prune(&self, count: usize)
fn record_tool_output_prune(&self, count: usize)
Record that tool outputs were pruned.
count is the number of tool-output bodies pruned in this pass.
Sourcefn record_compaction_probe_pass(
&self,
score: f32,
category_scores: Vec<CategoryScore>,
threshold: f32,
hard_fail_threshold: f32,
)
fn record_compaction_probe_pass( &self, score: f32, category_scores: Vec<CategoryScore>, threshold: f32, hard_fail_threshold: f32, )
Record a probe pass verdict with full score data.
Sourcefn record_compaction_probe_soft_fail(
&self,
score: f32,
category_scores: Vec<CategoryScore>,
threshold: f32,
hard_fail_threshold: f32,
)
fn record_compaction_probe_soft_fail( &self, score: f32, category_scores: Vec<CategoryScore>, threshold: f32, hard_fail_threshold: f32, )
Record a probe soft-fail verdict with full score data.
Sourcefn record_compaction_probe_hard_fail(
&self,
score: f32,
category_scores: Vec<CategoryScore>,
threshold: f32,
hard_fail_threshold: f32,
)
fn record_compaction_probe_hard_fail( &self, score: f32, category_scores: Vec<CategoryScore>, threshold: f32, hard_fail_threshold: f32, )
Record a probe hard-fail verdict with full score data.
Sourcefn record_compaction_probe_error(&self)
fn record_compaction_probe_error(&self)
Record that the probe returned an error (non-fatal; compaction proceeded).