Struct CostSummary
pub struct CostSummary {
pub session_cost_usd: f64,
pub daily_cost_usd: f64,
pub monthly_cost_usd: f64,
pub total_tokens: u64,
pub request_count: usize,
pub rejected_records: usize,
pub by_model: HashMap<String, ModelStats>,
pub by_agent: HashMap<String, AgentCostStats>,
}Expand description
Cost summary for reporting.
Fields§
§session_cost_usd: f64Total cost for the session
daily_cost_usd: f64Total cost for the day
monthly_cost_usd: f64Total cost for the month
total_tokens: u64Total tokens used
request_count: usizeNumber of requests
rejected_records: usizeLedger lines the summary scan could not read as complete cost records. This is a ledger-wide integrity count, not a count scoped to the summary’s window, agent, or task: a torn line has no readable timestamp, so it can’t be attributed to a scope. Non-zero means the ledger is damaged and the totals above may exclude whatever those lines held; the raw lines stay in the ledger.
by_model: HashMap<String, ModelStats>Breakdown by model
by_agent: HashMap<String, AgentCostStats>Breakdown by agent alias. Empty when [cost].track_per_agent = false or when no records carry an agent_alias.
Trait Implementations§
Source§impl Clone for CostSummary
impl Clone for CostSummary
Source§fn clone(&self) -> CostSummary
fn clone(&self) -> CostSummary
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CostSummary
impl Debug for CostSummary
Source§impl Default for CostSummary
impl Default for CostSummary
Source§fn default() -> CostSummary
fn default() -> CostSummary
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CostSummary
impl<'de> Deserialize<'de> for CostSummary
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CostSummary, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CostSummary, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CostSummary
impl Serialize for CostSummary
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
Auto Trait Implementations§
impl Freeze for CostSummary
impl RefUnwindSafe for CostSummary
impl Send for CostSummary
impl Sync for CostSummary
impl Unpin for CostSummary
impl UnsafeUnpin for CostSummary
impl UnwindSafe for CostSummary
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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