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

Function logCost

test/skill-e2e.test.ts:140–144  ·  view source on GitHub ↗

* Print cost summary after an E2E test.

(label: string, result: { costEstimate: { turnsUsed: number; estimatedTokens: number; estimatedCost: number }; duration: number })

Source from the content-addressed store, hash-verified

138 * Print cost summary after an E2E test.
139 */
140function logCost(label: string, result: { costEstimate: { turnsUsed: number; estimatedTokens: number; estimatedCost: number }; duration: number }) {
141 const { turnsUsed, estimatedTokens, estimatedCost } = result.costEstimate;
142 const durationSec = Math.round(result.duration / 1000);
143 console.log(`${label}: $${estimatedCost.toFixed(2)} (${turnsUsed} turns, ${(estimatedTokens / 1000).toFixed(1)}k tokens, ${durationSec}s)`);
144}
145
146/**
147 * Dump diagnostic info on planted-bug outcome failure (decision 1C).

Callers 2

skill-e2e.test.tsFile · 0.70
runPlantedBugEvalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected