Skip to main content

bucket_text

Function bucket_text 

Source
pub fn bucket_text(
    rows: &[Row],
    now_ms: i64,
    lookback_ms: i64,
    size_ms: i64,
    tz_secs: i64,
    colour: bool,
    fmt: Fmt,
) -> String
Expand description

Spend per bucket (day or hour), oldest first — cmduse daily/hourly. lookback_ms is the read window and size_ms the bucket width (which also names the first CSV/JSON column: day for a ≥24h bucket, else hour). The Csv columns are that key plus the store’s numeric fields (…,requests,tokens_in,tokens_out,cache_read,cost_usd; no cache-write), the Json form {scope,source,total,days|hours}, and Table is the original framing but for Ink’s colour. Json/Csv are never coloured.