pub struct UsageReport {Show 14 fields
pub scope: EvaluationScope,
pub record_count: usize,
pub run_count: usize,
pub turn_count: usize,
pub provider_call_count: u64,
pub provider_input_tokens: u64,
pub provider_output_tokens: u64,
pub provider_total_tokens: u64,
pub tool_call_count: u64,
pub tool_completed_count: u64,
pub tool_non_success_count: u64,
pub elapsed_ms: Option<u64>,
pub tool_total_elapsed_ms: Option<u64>,
pub limitations: Vec<String>,
}Expand description
Provider/tool usage report derived from durable trace evidence.
Fields§
§scope: EvaluationScopeScope this usage report describes.
record_count: usizeNumber of journal records inspected.
run_count: usizeNumber of runs represented in the source trace.
turn_count: usizeNumber of turns represented in the source trace.
provider_call_count: u64Number of completed provider calls.
provider_input_tokens: u64Sum of provider input tokens.
provider_output_tokens: u64Sum of provider output tokens.
provider_total_tokens: u64Sum of provider total tokens.
tool_call_count: u64Number of distinct tool calls.
tool_completed_count: u64Number of completed tool calls.
tool_non_success_count: u64Number of failed, timed out, cancelled, denied, unknown, or recovery-required tool calls.
elapsed_ms: Option<u64>Elapsed time across the scope when durable timestamps support it.
tool_total_elapsed_ms: Option<u64>Sum of per-tool elapsed milliseconds when available.
limitations: Vec<String>Limitations found while deriving usage.
Implementations§
Source§impl UsageReport
impl UsageReport
Sourcepub fn from_run_trace(trace: &RunTrace) -> Result<Self, AgentError>
pub fn from_run_trace(trace: &RunTrace) -> Result<Self, AgentError>
Builds a usage report from a run trace.
Sourcepub fn from_trace_metrics(metrics: TraceMetrics) -> Result<Self, AgentError>
pub fn from_trace_metrics(metrics: TraceMetrics) -> Result<Self, AgentError>
Builds a usage report from precomputed trace metrics.
Trait Implementations§
Source§impl Clone for UsageReport
impl Clone for UsageReport
Source§fn clone(&self) -> UsageReport
fn clone(&self) -> UsageReport
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 Debug for UsageReport
impl Debug for UsageReport
Source§impl<'de> Deserialize<'de> for UsageReport
impl<'de> Deserialize<'de> for UsageReport
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
impl Eq for UsageReport
Source§impl PartialEq for UsageReport
impl PartialEq for UsageReport
Source§fn eq(&self, other: &UsageReport) -> bool
fn eq(&self, other: &UsageReport) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for UsageReport
impl Serialize for UsageReport
impl StructuralPartialEq for UsageReport
Auto Trait Implementations§
impl Freeze for UsageReport
impl RefUnwindSafe for UsageReport
impl Send for UsageReport
impl Sync for UsageReport
impl Unpin for UsageReport
impl UnsafeUnpin for UsageReport
impl UnwindSafe for UsageReport
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