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

Function report_json

rust/crates/ccusage/src/adapter/opencode/report.rs:9–17  ·  view source on GitHub ↗
(
    entries: &[LoadedEntry],
    kind: AgentReportKind,
    order: &SortOrder,
)

Source from the content-addressed store, hash-verified

7};
8
9pub(crate) fn report_json(
10 entries: &[LoadedEntry],
11 kind: AgentReportKind,
12 order: &SortOrder,
13) -> Result<Value> {
14 let mut rows = summarize_entries(entries, kind)?;
15 sort_summaries(&mut rows, order, |row| summary_period(row));
16 Ok(report_from_rows(&rows, kind))
17}
18
19fn report_from_rows(rows: &[crate::UsageSummary], kind: AgentReportKind) -> Value {
20 let rows_json = rows

Callers 1

runFunction · 0.70

Calls 4

sort_summariesFunction · 0.85
summarize_entriesFunction · 0.70
summary_periodFunction · 0.70
report_from_rowsFunction · 0.70

Tested by

no test coverage detected