import { IStat } from "../model/IStat"; import { ITags } from "../model/ITags"; import { StatsReporter } from "./StatsReporter"; export declare class StatsManager { static readonly samplePeriodMs: number; private buffer; private reporters; private flushInterval; private tags; constructor(config?: { tags?: ITags; }); shutdown(): Promise; /** * Aggregates a value into the IStat record at key. */ aggregate(metric: string, value: number | IStat, tags?: ITags): void; /** * Aggregates 1 into the IStat record at key. */ increment(metric: string, tags?: ITags): void; /** * Times a function call and the promise it produces. * The timing statistic is only recorded if the function * returns without an exception. */ timer(metric: string, f: () => Promise, tags?: ITags): Promise; /** * Register a reporter. */ registerStatsReporter(statsReporter: StatsReporter): void; setTag(key: string, value: string): void; private addToBuffer; private write; private flushStats; private encodeKey; private decodeKey; private filterTags; }