import { StatisticColumn } from '../Columns'; import { MapToParams } from '../Parameterization'; import { BenchmarkingSettings, TestFn } from '../types'; import { Benchmark, BenchmarkOptions } from './Benchmark'; import { JobConfig } from './JobConfig'; export interface BenchmarkJobOptions extends BenchmarkingSettings { /** * The columns to display the statistic data in the summary table. * * By default the summary table contains the Mean column, Standard Error column and Standard Deviation column, * you cannot disable them. */ columns?: (StatisticColumn | (() => StatisticColumn))[]; } export declare class BenchmarkJob extends JobConfig { private readonly _benchs; private _setupCount; private _cleanupCount; private _paramStore; private readonly _settings; private readonly _statsColumnOrder; constructor(options?: Readonly); setColumnOrder(order: StatisticColumn[]): this; add(bench: Benchmark): this; add(testFn: T, options?: BenchmarkOptions): this; add(name: string, testFn: T, options?: BenchmarkOptions): this; /** @deprecated Please use `setSetup` instead. */ addSetup(setup: () => void): this; /** * Adds global setup. * The global setup function will be executed only once before all the benchmark function invocations. * * NOTE: An benchmark job can only have one global setup function. * * @param setup A callback function that does some setup work. * @returns The benchmark instance itself. */ setSetup(setup: () => void): this; /** * Adds global setup. * The global setup function will be executed only once before all the benchmark function invocations. * * NOTE: An benchmark job can only have one global setup function. * * @param setup A callback function that does some setup work. * @param params The parameters passed to the setup function. * @returns The benchmark instance itself. */ setSetup(setup: (...args: Args) => void, params: MapToParams): this; /** @deprecated Please use `setCleanup` instead. */ addCleanup(cleanup: () => void): this; /** * Adds global cleanup. * The global cleanup function will be executed only once after all the benchmark function invocations. * * NOTE: An benchmark job can only have one global cleanup function. * * @param cleanup A callback function that does some cleanup work. * @returns The benchmark instance itself. */ setCleanup(cleanup: () => void): this; private benchmarkToTask; run(): void; /** * Validates this benchmark job. * @returns Returns `false` if problems in this benchmark job, otherwise `true`. */ validate(): boolean; }