pub struct Totals {
pub events: u64,
pub requests: u64,
pub input: u64,
pub output: u64,
pub cache_read: u64,
pub cache_write: u64,
pub cost: Cost,
pub sessions: BTreeSet<String>,
pub first_ts: Option<i64>,
pub last_ts: Option<i64>,
}Expand description
Everything summed for one bucket of events.
Fields§
§events: u64Events in the bucket, whether or not they carried usage.
requests: u64Events that carried usage — i.e. billable requests.
input: u64§output: u64§cache_read: u64§cache_write: u64§cost: Cost§sessions: BTreeSet<String>§first_ts: Option<i64>§last_ts: Option<i64>Implementations§
Source§impl Totals
impl Totals
pub fn add(&mut self, event: &Event, pricing: &Pricing)
pub fn merge(&mut self, other: &Totals)
pub fn total_tokens(&self) -> u64
Sourcepub fn tail_cells(&self) -> Vec<Cell>
pub fn tail_cells(&self) -> Vec<Cell>
The four columns every report ends with: in, out, cache read, cost.
Sourcepub fn write_json(&self, row: &mut Map<String, Value>)
pub fn write_json(&self, row: &mut Map<String, Value>)
The token fields, written into a JSON row.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Totals
impl RefUnwindSafe for Totals
impl Send for Totals
impl Sync for Totals
impl Unpin for Totals
impl UnsafeUnpin for Totals
impl UnwindSafe for Totals
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