container.ts
Version:
Modular application framework
28 lines (27 loc) • 1.02 kB
TypeScript
/** Metric types supported by StatsD. */
export declare enum EMetricType {
Increment = 0,
Decrement = 1,
Gauge = 2,
Timing = 3,
Histogram = 4,
}
/** Metric tags. */
export interface IMetricTags extends Object {
[key: string]: any;
}
/** Abstract metric class. */
export declare abstract class Metric {
/** Send i counter metric. */
increment(name: string, value?: number, tags?: IMetricTags): void;
/** Send decrement counter metric. */
decrement(name: string, value?: number, tags?: IMetricTags): void;
/** Send value metric. */
gauge(name: string, value: number, tags?: IMetricTags): void;
/** Send time metric in milliseconds. */
timing(name: string, value: number | Date, tags?: IMetricTags): void;
/** Send distribution value metric. */
histogram(name: string, value: number, tags?: IMetricTags): void;
/** Metric method provided by implementor. */
protected abstract metric(type: EMetricType, name: string, value: any, tags: IMetricTags): void;
}