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

Function key

src/compiled/metrics.ts:26–29  ·  view source on GitHub ↗
(name: string, labels: Record<string, string>)

Source from the content-addressed store, hash-verified

24const metrics: Map<string, Metric> = new Map();
25
26function key(name: string, labels: Record<string, string>): string {
27 const parts = Object.keys(labels).sort().map(k => `${k}="${labels[k]}"`);
28 return parts.length > 0 ? `${name}{${parts.join(",")}}` : name;
29}
30
31export function counter(name: string, labels: Record<string, string> = {}): void {
32 const k = key(name, labels);

Callers 3

counterFunction · 0.70
histogramFunction · 0.70
gaugeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected