mirror of https://github.com/immich-app/immich.git
refactor(server): rename metrics to telemetry (#13584)
parent
b1149881bd
commit
3fb5adb31c
@ -1,31 +0,0 @@
|
||||
import { IMetricRepository } from 'src/interfaces/metric.interface';
|
||||
import { Mocked, vitest } from 'vitest';
|
||||
|
||||
export const newMetricRepositoryMock = (): Mocked<IMetricRepository> => {
|
||||
return {
|
||||
api: {
|
||||
addToCounter: vitest.fn(),
|
||||
addToGauge: vitest.fn(),
|
||||
addToHistogram: vitest.fn(),
|
||||
configure: vitest.fn(),
|
||||
},
|
||||
host: {
|
||||
addToCounter: vitest.fn(),
|
||||
addToGauge: vitest.fn(),
|
||||
addToHistogram: vitest.fn(),
|
||||
configure: vitest.fn(),
|
||||
},
|
||||
jobs: {
|
||||
addToCounter: vitest.fn(),
|
||||
addToGauge: vitest.fn(),
|
||||
addToHistogram: vitest.fn(),
|
||||
configure: vitest.fn(),
|
||||
},
|
||||
repo: {
|
||||
addToCounter: vitest.fn(),
|
||||
addToGauge: vitest.fn(),
|
||||
addToHistogram: vitest.fn(),
|
||||
configure: vitest.fn(),
|
||||
},
|
||||
};
|
||||
};
|
||||
@ -0,0 +1,20 @@
|
||||
import { ITelemetryRepository } from 'src/interfaces/telemetry.interface';
|
||||
import { Mocked, vitest } from 'vitest';
|
||||
|
||||
const newMetricGroupMock = () => {
|
||||
return {
|
||||
addToCounter: vitest.fn(),
|
||||
addToGauge: vitest.fn(),
|
||||
addToHistogram: vitest.fn(),
|
||||
configure: vitest.fn(),
|
||||
};
|
||||
};
|
||||
|
||||
export const newTelemetryRepositoryMock = (): Mocked<ITelemetryRepository> => {
|
||||
return {
|
||||
api: newMetricGroupMock(),
|
||||
host: newMetricGroupMock(),
|
||||
jobs: newMetricGroupMock(),
|
||||
repo: newMetricGroupMock(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue