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

Function histogram

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

Source from the content-addressed store, hash-verified

39}
40
41export function histogram(name: string, value: number, labels: Record<string, string> = {}): void {
42 const k = key(name, labels);
43 const existing = metrics.get(k);
44 if (existing && existing.type === "histogram") {
45 existing.values.push(value);
46 } else {
47 metrics.set(k, { type: "histogram", values: [value], labels });
48 }
49}
50
51export function gauge(name: string, value: number, labels: Record<string, string> = {}): void {
52 const k = key(name, labels);

Callers 4

prompt_code_assistFunction · 0.90
prompt_compress_historyFunction · 0.90
runLoopFunction · 0.90

Calls 2

keyFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected