MCPcopy Create free account
hub / github.com/ccusage/ccusage / report_from_rows

Function report_from_rows

rust/crates/ccusage/src/adapter/codebuff/report.rs:9–18  ·  view source on GitHub ↗
(rows: &[UsageSummary], kind: AgentReportKind)

Source from the content-addressed store, hash-verified

7};
8
9pub(crate) fn report_from_rows(rows: &[UsageSummary], kind: AgentReportKind) -> Value {
10 let rows_json = rows
11 .iter()
12 .map(|row| crate::adapter::opencode::agent_summary_json(row, kind, false))
13 .collect::<Vec<_>>();
14 serde_json::json!({
15 rows_key(kind): rows_json,
16 "totals": totals_json(rows),
17 })
18}
19
20pub(super) fn summary_period(row: &UsageSummary) -> &str {
21 row.date

Callers 2

runFunction · 0.70
report_includes_creditsFunction · 0.70

Calls 1

agent_summary_jsonFunction · 0.85

Tested by 1

report_includes_creditsFunction · 0.56