(name: string, labels: Record<string, string> = {})
| 29 | } |
| 30 | |
| 31 | export 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 | |
| 41 | export function histogram(name: string, value: number, labels: Record<string, string> = {}): void { |
| 42 | const k = key(name, labels); |
no test coverage detected