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.
Implementations§
Source§impl StatsStore
impl StatsStore
Sourcepub fn compression_totals(&self) -> CompressionTotals
pub fn compression_totals(&self) -> CompressionTotals
Computes effective compression from tagged command rows.
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<StatsStore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StatsStore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StatsStore
impl PartialEq for StatsStore
Source§impl Serialize for StatsStore
impl Serialize for StatsStore
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for StatsStore
Auto Trait Implementations§
impl Forget for StatsStore
impl Freeze for StatsStorewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, CommandStats)>: Freeze,
PhantomData<DayStats>: Freeze,
PhantomData<(String, u64)>: Freeze,
PhantomData<CepSessionSnapshot>: Freeze,
PhantomData<(String, TrafficClass)>: Freeze,
impl Move for StatsStore
impl RefUnwindSafe for StatsStore
impl Send for StatsStorewhere
RawVecInner: Send,
RawTable<(String, CommandStats)>: Send,
RawTable<(String, u64)>: Send,
RawTable<(String, TrafficClass)>: Send,
impl Sync for StatsStorewhere
RawVecInner: Sync,
RawTable<(String, CommandStats)>: Sync,
RawTable<(String, u64)>: Sync,
RawTable<(String, TrafficClass)>: Sync,
impl Unpin for StatsStore
impl UnsafeUnpin for StatsStorewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, CommandStats)>: UnsafeUnpin,
PhantomData<DayStats>: UnsafeUnpin,
PhantomData<(String, u64)>: UnsafeUnpin,
PhantomData<CepSessionSnapshot>: UnsafeUnpin,
PhantomData<(String, TrafficClass)>: UnsafeUnpin,
impl UnwindSafe for StatsStorewhere
RawVecInner: UnwindSafe,
HashMap<String, CommandStats>: UnwindSafe,
HashMap<String, u64>: UnwindSafe,
HashMap<String, TrafficClass>: UnwindSafe,
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>,
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