MCPcopy Create free account
hub / github.com/anus-dev/ANUS / calculateCacheHitRate

Function calculateCacheHitRate

packages/cli/src/ui/utils/computeStats.ts:28–33  ·  view source on GitHub ↗
(metrics: ModelMetrics)

Source from the content-addressed store, hash-verified

26}
27
28export function calculateCacheHitRate(metrics: ModelMetrics): number {
29 if (metrics.tokens.prompt === 0) {
30 return 0;
31 }
32 return (metrics.tokens.cached / metrics.tokens.prompt) * 100;
33}
34
35export const computeSessionStats = (
36 metrics: SessionMetrics,

Callers 2

ModelStatsDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected