pub struct UsageSnapshot {
pub endpoints: HashMap<String, EndpointUsage>,
pub total_cost: f64,
pub total_calls: u64,
pub total_tokens: u64,
pub total_input_tokens: u64,
pub total_output_tokens: u64,
pub total_cached_input_tokens: u64,
pub total_cache_creation_input_tokens: u64,
pub models: Vec<String>,
}Expand description
Aggregated usage across all endpoints for a test or scenario run.
Fields§
§endpoints: HashMap<String, EndpointUsage>Per-endpoint usage.
total_cost: f64Total cost across all endpoints.
total_calls: u64Total calls across all endpoints.
total_tokens: u64Total tokens across all endpoints.
total_input_tokens: u64Total input (prompt) tokens across all endpoints.
total_output_tokens: u64Total output (completion) tokens across all endpoints.
total_cached_input_tokens: u64Total input tokens served from provider prompt caches.
total_cache_creation_input_tokens: u64Total input tokens written to provider prompt caches.
models: Vec<String>Model names observed across all endpoints, sorted and deduplicated.
Implementations§
Source§impl UsageSnapshot
impl UsageSnapshot
Sourcepub fn from_endpoints(endpoints: &HashMap<String, EndpointUsage>) -> Self
pub fn from_endpoints(endpoints: &HashMap<String, EndpointUsage>) -> Self
Creates a snapshot from per-endpoint usage data.
Trait Implementations§
Source§impl Clone for UsageSnapshot
impl Clone for UsageSnapshot
Source§impl Debug for UsageSnapshot
impl Debug for UsageSnapshot
Auto Trait Implementations§
impl Freeze for UsageSnapshot
impl RefUnwindSafe for UsageSnapshot
impl Send for UsageSnapshot
impl Sync for UsageSnapshot
impl Unpin for UsageSnapshot
impl UnsafeUnpin for UsageSnapshot
impl UnwindSafe for UsageSnapshot
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