MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / totalUsage

Function totalUsage

packages/agent-core/src/agent/usage/index.ts:73–79  ·  view source on GitHub ↗
(byModel: Record<string, TokenUsage>)

Source from the content-addressed store, hash-verified

71}
72
73function totalUsage(byModel: Record<string, TokenUsage>): TokenUsage | undefined {
74 let total: TokenUsage | undefined;
75 for (const usage of Object.values(byModel)) {
76 total = total === undefined ? copyUsage(usage) : addUsage(total, usage);
77 }
78 return total;
79}

Callers 1

dataMethod · 0.85

Calls 3

addUsageFunction · 0.90
copyUsageFunction · 0.85
valuesMethod · 0.65

Tested by

no test coverage detected