/// <reference types="benchmark" />
import Executor from '../executors/Executor';
import Reporter, { ReporterProperties } from './Reporter';
import BenchmarkTest from '../BenchmarkTest';
import Test from '../Test';
import Suite from '../Suite';
import * as Benchmark from 'benchmark';
/**
 * Benchmark is a reporter that can generate a baseline report and do runtime comparisons against an existing baseline.
 *
 * Configuration
 * -------------
 * Along with the default reporter options, Benchmark also supports a `mode` option. This can have two
 * values:
 *
 *     'baseline': Benchmark data will be written to a baseline file when testing is finished
 *     'test': Benchmark is compared to a baseline read from a file when testing starts
 *
 * Baseline data is stored hierarchically by environment and then by test.
 *
 * Notation
 * --------
 * rme: relative margin of error -- margin of error as a percentage of the mean margin of error
 * mean: mean execution time per function run
 * hz: Hertz (number of executions of a function per second). 1/Hz is the mean execution time of function.
 */
export default class BenchmarkReporter extends Reporter implements BenchmarkReporterProperties {
    baseline: BenchmarkBaseline;
    filename: string;
    mode: BenchmarkMode;
    sessions: {
        [sessionId: string]: SessionInfo;
    };
    verbosity: number;
    thresholds: BenchmarkThresholds;
    constructor(executor: Executor, config: BenchmarkReporterOptions);
    _getSession(testOrSuite: Test | Suite): SessionInfo;
    runEnd(): void;
    suiteEnd(suite: Suite): void;
    suiteStart(suite: Suite): void;
    testEnd(test: BenchmarkTest): void;
}
export interface BenchmarkData {
    times: Benchmark.Times;
    hz: number;
    stats: {
        rme: number;
        moe: number;
        mean: number;
    };
}
export interface BenchmarkThresholds {
    warn?: {
        rme?: number;
        hz?: number;
        mean?: number;
    };
    fail?: {
        rme?: number;
        hz?: number;
        mean?: number;
    };
}
export interface BaselineEnvironment {
    client: string;
    version: string;
    platform: string;
    tests: {
        [testId: string]: BenchmarkData;
    };
}
export interface BenchmarkBaseline {
    [key: string]: BaselineEnvironment;
}
export interface SesssionEnvironment {
    client: string;
    version: string;
    platform: string;
    id: string;
}
export interface SessionInfo {
    suites: {
        [suiteId: string]: {
            numBenchmarks: number;
            numFailedBenchmarks: number;
        };
    };
    environment: SesssionEnvironment;
}
export declare type BenchmarkMode = 'baseline' | 'test';
export interface BenchmarkReporterProperties extends ReporterProperties {
    filename: string;
    mode: BenchmarkMode;
    thresholds: BenchmarkThresholds;
    verbosity: number;
}
export declare type BenchmarkReporterOptions = Partial<BenchmarkReporterProperties>;
