pub struct DayStats {
pub date: String,
pub commands: usize,
pub input_tokens: usize,
pub output_tokens: usize,
pub saved_tokens: usize,
pub savings_pct: f64,
pub total_time_ms: u64,
pub avg_time_ms: u64,
}Expand description
Daily statistics for token savings and execution metrics.
Serializable to JSON for export via rtk gain --daily --format json.
§JSON Schema
{
"date": "2026-02-03",
"commands": 42,
"input_tokens": 15420,
"output_tokens": 3842,
"saved_tokens": 11578,
"savings_pct": 75.08,
"total_time_ms": 8450,
"avg_time_ms": 201
}Fields§
§date: StringISO date (YYYY-MM-DD)
commands: usizeNumber of commands executed this day
input_tokens: usizeTotal input tokens for this day
output_tokens: usizeTotal output tokens for this day
saved_tokens: usizeTotal tokens saved this day
savings_pct: f64Savings percentage for this day
total_time_ms: u64Total execution time for this day (milliseconds)
avg_time_ms: u64Average execution time per command (milliseconds)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DayStats
impl RefUnwindSafe for DayStats
impl Send for DayStats
impl Sync for DayStats
impl Unpin for DayStats
impl UnsafeUnpin for DayStats
impl UnwindSafe for DayStats
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