import { Readable } from 'stream';
import { EventEmitter } from 'events';
import { CountedEvent, CountedEventMap } from './countedEvents';
interface Statistics {
    intervalDuration: number;
    context: any;
    counterDefs: any[];
    watcherDefs: any;
    timerDefs: {
        [name: string]: TimerRing;
    };
    manualStatDefs: any[];
    fifoStatDefs: any[];
    interval: NodeJS.Timeout;
    snapshotWriteFns: any[];
    stream: Readable;
    streamIsPushable: boolean;
    counters: any;
    watchers: any;
    timers: any;
    manualStats: {
        [name: string]: ManualRing;
    };
    fifoStats: {
        [name: string]: FifoStats;
    };
    ringOverrides: {
        [override: string]: number;
    };
    fifoOverrides: {
        [override: string]: number;
    };
    countedEventMap: CountedEventMap;
}
declare class Statistics extends EventEmitter {
    constructor(baseDir: string, config: any, { counters, watchers, timers, manualStats, fifoStats, ringOverrides, fifoOverrides, }: {
        counters: string[];
        watchers: any;
        timers: any;
        manualStats: string[];
        fifoStats: string[];
        ringOverrides: {
            [override: string]: number;
        };
        fifoOverrides: {
            [override: string]: number;
        };
    }, context: any);
    initialize(): void;
    getStream(): Readable;
    writeOnSnapshot(writeFn: any, context: any): void;
    startSnapshots(): void;
    stopSnapshots(): void;
    incrementCounter(counterName: any): void;
    /**
     * Stores a new CountedEvent in a map
     * @param category
     * @param name
     * @param count
     * @param message
     * @returns
     */
    countEvent(category: string, name: string, count: number, message: string): void;
    /**
     * Get an array of all the CountedEvents
     * @returns
     */
    getAllCountedEvents(): CountedEvent[];
    /**
     * Resets the internal CountedEventMap
     */
    resetCountedEvents(): void;
    setManualStat(manualStatName: any, value: number): void;
    setFifoStat(fifoStatName: any, value: number): void;
    getCurrentCount(counterName: any): any;
    getCounterTotal(counterName: any): any;
    getWatcherValue(watcherName: any): any;
    startTimer(timerName: any, id: any): void;
    stopTimer(timerName: any, id: any): void;
    getAverage(name: any): any;
    getMultiStatReport(name: any): any;
    getMax(name: any): any;
    clearRing(name: any): any;
    getPreviousElement(name: any): any;
    _initializeCounters(counterDefs?: any[]): {};
    _initializeWatchers(watcherDefs: {}, context: any): {};
    _initializeTimers(timerDefs?: any): any;
    _initializeManualStats(counterDefs?: any[], ringOverrides?: {}): {};
    _initializeFifoStats(fifoStatsDefs?: any[], statsOverrides?: {}): {};
    _takeSnapshot(): void;
    _pushToStream(data: any): void;
}
interface Ring {
    elements: any[];
    index: number;
    length: number;
}
declare class Ring {
    constructor(length: any);
    save(value: any): void;
    average(): number;
    multiStats(): {
        min: number;
        max: number;
        avg: number;
        allVals: any[];
        sum: number;
    };
    max(): number;
    previous(): any;
    clear(): void;
}
interface TimerRing {
    ids: any;
    ring: Ring;
}
declare class TimerRing {
    constructor(length: any);
    start(id: string): void;
    stop(id: string): void;
    snapshot(): void;
}
interface ManualRing {
    ring: Ring;
}
declare class FifoStats {
    private items;
    private length;
    constructor(limit?: number);
    save(item: any): void;
    average(): number;
    max(): number;
    multiStats(): {
        min: number;
        max: number;
        avg: number;
        allVals: any[];
        sum: number;
    };
}
declare class ManualRing {
    constructor(length: any);
    manualSetValue(value: any): void;
    snapshot(): void;
}
export default Statistics;
