mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): metric repo (#8278)
* refactor * redundant `implements` * simplify * remove `enabled`
This commit is contained in:
parent
c56c04a82b
commit
c45e28ab53
4 changed files with 79 additions and 34 deletions
|
|
@ -1,13 +1,21 @@
|
|||
import { MetricOptions } from '@opentelemetry/api';
|
||||
|
||||
export interface CustomMetricOptions extends MetricOptions {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export const IMetricRepository = 'IMetricRepository';
|
||||
|
||||
export interface IMetricRepository {
|
||||
addToCounter(name: string, value: number, options?: CustomMetricOptions): void;
|
||||
updateGauge(name: string, value: number, options?: CustomMetricOptions): void;
|
||||
updateHistogram(name: string, value: number, options?: CustomMetricOptions): void;
|
||||
export interface MetricGroupOptions {
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface IMetricGroupRepository {
|
||||
addToCounter(name: string, value: number, options?: MetricOptions): void;
|
||||
addToGauge(name: string, value: number, options?: MetricOptions): void;
|
||||
addToHistogram(name: string, value: number, options?: MetricOptions): void;
|
||||
configure(options: MetricGroupOptions): this;
|
||||
}
|
||||
|
||||
export interface IMetricRepository {
|
||||
api: IMetricGroupRepository;
|
||||
host: IMetricGroupRepository;
|
||||
jobs: IMetricGroupRepository;
|
||||
repo: IMetricGroupRepository;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue