pub struct CompactTelemetry {
pub trigger: CompactReason,
pub pre_compact: PreCompactStats,
pub post_compact: PostCompactStats,
pub duration: Duration,
}Expand description
Telemetry data for a single compaction operation.
Produced by ContextManager::ensure_context_fits
when compaction occurs. Observers receive this via
on_compaction.
Fields§
§trigger: CompactReasonWhy compaction was triggered.
The CompactReason that caused this pass, useful for distinguishing
routine threshold compactions from emergency or manual ones when reading
the telemetry.
pre_compact: PreCompactStatsConversation stats before compaction.
A snapshot of the conversation as it was when compaction began — message
counts broken down by role and token estimate. See PreCompactStats.
post_compact: PostCompactStatsConversation stats after compaction.
A snapshot of the conversation after compaction completed, plus the
savings achieved. Compare against pre_compact to
measure the effect of the pass. See PostCompactStats.
duration: DurationWall-clock duration of the compaction.
Time spent inside the compactor’s compact call for this pass, measured
from just before the call to just after. Excludes the token-estimate
bookkeeping done before and after the call itself.
Trait Implementations§
Source§impl Clone for CompactTelemetry
impl Clone for CompactTelemetry
Source§fn clone(&self) -> CompactTelemetry
fn clone(&self) -> CompactTelemetry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more