MCPcopy
hub / github.com/Doorman11991/smallcode / counter

Function counter

src/compiled/metrics.ts:31–39  ·  view source on GitHub ↗
(name: string, labels: Record<string, string> = {})

Source from the content-addressed store, hash-verified

29}
30
31export function counter(name: string, labels: Record<string, string> = {}): void {
32 const k = key(name, labels);
33 const existing = metrics.get(k);
34 if (existing && existing.type === "counter") {
35 existing.value++;
36 } else {
37 metrics.set(k, { type: "counter", value: 1, labels });
38 }
39}
40
41export function histogram(name: string, value: number, labels: Record<string, string> = {}): void {
42 const k = key(name, labels);

Callers 15

executeFlowFunction · 0.90
getFunction · 0.90
putFunction · 0.90
prompt_code_assistFunction · 0.90
prompt_compress_historyFunction · 0.90
repair_code_assistFunction · 0.90
assertCanSpendMethod · 0.90
chargeMethod · 0.90
refundMethod · 0.90
writeSpanFunction · 0.90
finalizeFunction · 0.90

Calls 2

keyFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected