Skip to content

Commit

Permalink
Test against real metrics with test meter
Browse files Browse the repository at this point in the history
  • Loading branch information
matschaffer committed Jun 14, 2022
1 parent 2804efc commit d02dceb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions x-pack/plugins/alerting/server/monitoring/metrics.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
* 2.0.
*/

function createInMemoryMetricsMock() {
return jest.fn().mockImplementation(() => {
return {
ruleExecutions: { add: jest.fn() },
};
});
}
import { metrics } from '@opentelemetry/api-metrics';
import { Metrics } from './metrics';

export const metricsMock = {
create: createInMemoryMetricsMock(),
create: () => new Metrics(metrics.getMeter('kibana.alerting.metrics.mock')),
};

0 comments on commit d02dceb

Please sign in to comment.