pub struct UsageStats {
pub total_input_tokens: u32,
pub total_output_tokens: u32,
pub total_cache_read_tokens: u32,
pub total_cache_write_tokens: u32,
pub request_count: u32,
pub total_cost_usd: f64,
pub model_usage: HashMap<String, ModelUsage>,
pub session_start: SystemTime,
pub last_request: Option<SystemTime>,
}
Expand description
Accumulated usage statistics across all requests
Fields§
§total_input_tokens: u32
Total input tokens across all requests
total_output_tokens: u32
Total output tokens across all requests
total_cache_read_tokens: u32
Total cache read tokens
total_cache_write_tokens: u32
Total cache write tokens
request_count: u32
Number of requests made
total_cost_usd: f64
Total cost in USD
model_usage: HashMap<String, ModelUsage>
Usage by model
session_start: SystemTime
Session start time
last_request: Option<SystemTime>
Last request time
Trait Implementations§
Source§impl Clone for UsageStats
impl Clone for UsageStats
Source§fn clone(&self) -> UsageStats
fn clone(&self) -> UsageStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UsageStats
impl Debug for UsageStats
Auto Trait Implementations§
impl Freeze for UsageStats
impl RefUnwindSafe for UsageStats
impl Send for UsageStats
impl Sync for UsageStats
impl Unpin for UsageStats
impl UnwindSafe for UsageStats
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