pub struct TranscriptStats {Show 19 fields
pub requests: u64,
pub pass_through: u64,
pub viewed: u64,
pub flushes: u64,
pub consolidations: u64,
pub summarizer_calls: u64,
pub summarizer_failures: u64,
pub log_messages: usize,
pub sectioned_messages: usize,
pub sections: usize,
pub block_bytes: usize,
pub band_bytes: usize,
pub tail_bytes: usize,
pub log_bytes: usize,
pub log_content: LogContent,
pub input_tokens: u64,
pub cached_input_tokens: u64,
pub output_tokens: u64,
pub usage: UsageBreakdown,
}Expand description
The compaction’s benchmark snapshot: what the view has been doing,
and what the providers’ own usage says about the prefix cache. All
counters run from the transcript’s construction; a resumed session
keeps its run continuous by folding the saved counters in with
TranscriptStats::carry. The struct is the saved shape: the
frontend serializes it into the session file verbatim.
Fields§
§requests: u64Requests the decorator forwarded.
pass_through: u64Requests below the budget, sent byte-identical: the whole prefix a cache holds.
viewed: u64Requests carrying the compaction block plus the whole band.
flushes: u64Flushes: cut movements, the only moments the view’s prefix breaks.
consolidations: u64Consolidations: block rewrites past the block cap, each one a full cache break.
summarizer_calls: u64Summarizer calls issued, successes and failures together.
summarizer_failures: u64Summarizer calls that failed; each left the extractive stand-in in place.
log_messages: usizeThe mirror’s message count at the last request.
sectioned_messages: usizeMessages under the block at the last request: the cut.
sections: usizeThe block’s section count at the last request.
block_bytes: usizeThe block’s bytes at the last request.
band_bytes: usizeThe bytes carried whole from the cut to the log’s end, at the last request.
tail_bytes: usizeThe current turn’s bytes at the last request.
log_bytes: usizeThe log’s wire bytes at the last request — what the conversation actually holds, each message counted once. The usage split below sums the same content once per request; this is the once.
log_content: LogContentThe log’s bytes by category at the last request, counted once.
input_tokens: u64Input tokens the providers reported, summed over requests — cached tokens included.
cached_input_tokens: u64Of those, the tokens the provider served from its prompt cache.
output_tokens: u64Output tokens the providers reported, summed over requests.
usage: UsageBreakdownThe session’s usage split by category.
Implementations§
Source§impl TranscriptStats
impl TranscriptStats
Sourcepub fn cache_hit_rate(&self) -> Option<f64>
pub fn cache_hit_rate(&self) -> Option<f64>
The session’s prompt-cache hit rate: cached input over all
input. None before any usage was reported. The providers’
own numbers — the ground truth the stepped design optimizes.
Sourcepub fn carry(&mut self, saved: &Self)
pub fn carry(&mut self, saved: &Self)
Folds a saved session’s counters in, so a resumed session’s
stats read as one run with the pre-resume requests included:
the run counters and the usage split sum, the cache rate keeps
covering everything. The at-last-request snapshots describe
the mirror that measured them, so they stay this side’s —
except while this mirror has not looked at a log yet
(log_messages == 0), where the snapshot is what a Usage page
opened before the first request would otherwise render as
zeros, and the saved one is the honest figure.