/**
 * Mock OpenTelemetry Meter for testing metric instrument emission.
 * Records all counter and histogram data points for assertion.
 */
export class MockCounter {
    dataPoints = [];
    add(value, attributes) {
        this.dataPoints.push({ value, attributes });
    }
    get sum() {
        return this.dataPoints.reduce((acc, dp) => acc + dp.value, 0);
    }
}
export class MockHistogram {
    dataPoints = [];
    record(value, attributes) {
        this.dataPoints.push({ value, attributes });
    }
    get sum() {
        return this.dataPoints.reduce((acc, dp) => acc + dp.value, 0);
    }
}
/**
 * Mock OTEL Meter that tracks created instruments by name.
 * Cast to `Meter` when passing to `vi.spyOn(otelMetrics, 'getMeter')`.
 */
export class MockMeter {
    _counters = new Map();
    _histograms = new Map();
    createCounter(name) {
        const counter = new MockCounter();
        this._counters.set(name, counter);
        return counter;
    }
    createHistogram(name) {
        const histogram = new MockHistogram();
        this._histograms.set(name, histogram);
        return histogram;
    }
    getCounter(name) {
        return this._counters.get(name);
    }
    getHistogram(name) {
        return this._histograms.get(name);
    }
}
//# sourceMappingURL=mock-meter.js.map