pub struct StatsStore {Show 14 fields
pub total_commands: u64,
pub total_input_tokens: u64,
pub total_output_tokens: u64,
pub first_use: Option<String>,
pub last_use: Option<String>,
pub commands: HashMap<String, CommandStats>,
pub daily: Vec<DayStats>,
pub cep: CepStats,
pub command_classes: HashMap<String, TrafficClass>,
pub first_inject_tokens_saved: u64,
pub reread_tokens_saved: u64,
pub active_tool_result_tokens_saved: u64,
pub last_tool_result_turn: u64,
pub stream_tracked_results: u64,
}Expand description
Persistent store for all-time token savings, command stats, and daily history.
Fields§
§total_commands: u64§total_input_tokens: u64§total_output_tokens: u64§first_use: Option<String>§last_use: Option<String>§commands: HashMap<String, CommandStats>§daily: Vec<DayStats>§cep: CepStats§command_classes: HashMap<String, TrafficClass>Delivery classification recorded for each command. Older stats files do not have this map; callers infer classifications from the command key.
first_inject_tokens_saved: u64Savings when a compressed tool result first enters provider context.
reread_tokens_saved: u64Savings from previously injected tool results carried into later turns.
active_tool_result_tokens_saved: u64Savings still resident in the active transcript and eligible for re-read.
last_tool_result_turn: u64Last provider turn for which active tool-result re-reads were accrued.
stream_tracked_results: u64Number of results recorded with stream-aware accounting. Zero identifies legacy stats files whose aggregate savings need a display-time fallback.
Trait Implementations§
Source§impl Clone for StatsStore
impl Clone for StatsStore
Source§fn clone(&self) -> StatsStore
fn clone(&self) -> StatsStore
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 moreSource§impl Default for StatsStore
impl Default for StatsStore
Source§fn default() -> StatsStore
fn default() -> StatsStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StatsStore
impl<'de> Deserialize<'de> for StatsStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StatsStore
impl RefUnwindSafe for StatsStore
impl Send for StatsStore
impl Sync for StatsStore
impl Unpin for StatsStore
impl UnsafeUnpin for StatsStore
impl UnwindSafe for StatsStore
Blanket Implementations§
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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