#[non_exhaustive]pub struct StatsResponse {
pub completed_count: i32,
pub input_tokens: i64,
pub output_tokens: i64,
pub session_count: i32,
pub tool_calls: i32,
pub total_cost: f64,
pub total_duration_ms: i64,
pub turn_count: i32,
}Expand description
The response for GET /v1/stats.
The figures are sums over the trace-grain rollups, so they agree with the session detail and trace views rather than being a second count. Duration is served in milliseconds, not the nanoseconds the spans carry: a summed nanosecond figure over a wide window leaves a JSON consumer’s safe-integer range.
Models the contract’s StatsResponse schema.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.completed_count: i32The contract’s completed_count.
input_tokens: i64The contract’s input_tokens.
output_tokens: i64The contract’s output_tokens.
session_count: i32The contract’s session_count.
tool_calls: i32The contract’s tool_calls.
total_cost: f64The contract’s total_cost.
total_duration_ms: i64The contract’s total_duration_ms.
turn_count: i32The contract’s turn_count.
Trait Implementations§
Source§impl Clone for StatsResponse
impl Clone for StatsResponse
Source§fn clone(&self) -> StatsResponse
fn clone(&self) -> StatsResponse
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 ContractModel for StatsResponse
impl ContractModel for StatsResponse
Source§impl Debug for StatsResponse
impl Debug for StatsResponse
Source§impl Default for StatsResponse
impl Default for StatsResponse
Source§fn default() -> StatsResponse
fn default() -> StatsResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StatsResponsewhere
StatsResponse: Default,
impl<'de> Deserialize<'de> for StatsResponsewhere
StatsResponse: Default,
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
Source§impl PartialEq for StatsResponse
impl PartialEq for StatsResponse
Source§impl Serialize for StatsResponse
impl Serialize for StatsResponse
impl StructuralPartialEq for StatsResponse
Auto Trait Implementations§
impl Freeze for StatsResponse
impl RefUnwindSafe for StatsResponse
impl Send for StatsResponse
impl Sync for StatsResponse
impl Unpin for StatsResponse
impl UnsafeUnpin for StatsResponse
impl UnwindSafe for StatsResponse
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