MCPcopy Index your code
hub / github.com/garrytan/gstack / logCost

Function logCost

test/skill-routing-e2e.test.ts:147–151  ·  view source on GitHub ↗
(label: string, result: { costEstimate: { turnsUsed: number; estimatedTokens: number; estimatedCost: number }; duration: number })

Source from the content-addressed store, hash-verified

145}
146
147function logCost(label: string, result: { costEstimate: { turnsUsed: number; estimatedTokens: number; estimatedCost: number }; duration: number }) {
148 const { turnsUsed, estimatedTokens, estimatedCost } = result.costEstimate;
149 const durationSec = Math.round(result.duration / 1000);
150 console.log(`${label}: $${estimatedCost.toFixed(2)} (${turnsUsed} turns, ${(estimatedTokens / 1000).toFixed(1)}k tokens, ${durationSec}s)`);
151}
152
153function recordRouting(name: string, result: SkillTestResult, expectedSkill: string, actualSkill: string | undefined) {
154 evalCollector?.addTest({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected