vulcain-corejs
Version:
Vulcain micro-service framework
61 lines (60 loc) • 1.5 kB
TypeScript
export declare class MetricsConstant {
static duration: string;
static failure: string;
static allRequestsFailure: string;
static allRequestsDuration: string;
}
/**
* Metrics adapter interface
*
* @export
* @interface IMetrics
*/
export interface IMetrics {
encodeTags(...tags: Array<string>): any;
/**
* Increment a gauge
*
* @param {string} metric metric name
* @param {number} [delta] default 1
*
* @memberOf IMetrics
*/
increment(metric: string, customTags?: string, delta?: number): any;
/**
* Decrement a gauge
*
* @param {string} metric metric name
* @param {number} [delta] default -1
* *
* @memberOf IMetrics
*/
decrement(metric: string, customTags?: string, delta?: number): any;
/**
* Add value to a counter
*
* @param {string} metric metric name
* @param {number} [delta] value to add
*
* @memberOf IMetrics
*/
counter(metric: string, delta: number, customTags?: string): any;
/**
*
*
* @param {string} metric metric name
* @param {number} [delta] value to add
*
* @memberOf IMetrics
*/
gauge(metric: string, value: number, customTags?: string): any;
/**
* Set a duration
*
* @param {string} metric metric name
* @param {number} [delta] duration in ms
*
* @memberOf IMetrics
*/
timing(metric: string, duration: number, customTags?: string): any;
}