## Public API Report File for "@fluid-tools/benchmark" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts import type { Test } from 'mocha'; // @public @sealed export interface BatchedDurationTimer { readonly iterationsPerBatch: number; recordBatch(duration: number): boolean; timeAllBatches(callback: () => void): void; timeAllBatchesAsync(callback: () => Promise): Promise; timeBatch(callback: () => void): boolean; timeBatchAsync(callback: () => Promise): Promise; readonly timer: Timer; } // @public @sealed export interface BatchlessDurationTimer { time(callback: () => void): boolean; timeAsync(callback: () => Promise): Promise; } // @public @input export interface BenchmarkDescription { readonly category?: string; readonly testType?: TestType; readonly type?: BenchmarkType; } // @public export function benchmarkDuration(args: DurationBenchmark): BenchmarkDescription & BenchmarkFunction; // @public export function benchmarkDurationBatchless(args: DurationBenchmarkBatchless): BenchmarkDescription & BenchmarkFunction; // @public @sealed export interface BenchmarkError { readonly error: string; } // @public @input export interface BenchmarkFunction { readonly run: (timer: Timer) => CollectedData | Promise; } // @public export function benchmarkIt(options: MochaBenchmarkOptions): Test; // @public export function benchmarkMemoryUse(args: MemoryUseBenchmark): BenchmarkDescription & BenchmarkFunction; // @public export enum BenchmarkMode { Correctness = "correctness", Performance = "performance" } // @public @input export interface BenchmarkOptions extends Titled, BenchmarkDescription, BenchmarkFunction { } // @public @sealed export type BenchmarkResult = BenchmarkError | CollectedData; // @public @input export interface BenchmarkTimingOptions { maxBenchmarkDurationSeconds?: number; minBatchCount?: number; minBatchDurationSeconds?: number; startPhase?: Phase; } // @public export enum BenchmarkType { Diagnostic = 2, Measurement = 1, OwnCorrectness = 3, Perspective = 0 } // @public export class Box> { clear(): void; static empty>(): Box; static full>(item: T): Box; get value(): T; set value(v: T); } // @public export function captureResults(f: () => CollectedData | Promise, durationMeasurementName?: string): Promise<{ result: BenchmarkResult; exception?: Error; }>; // @public export function collectDurationData(args: DurationBenchmark): Promise; // @public export type CollectedData = readonly [PrimaryMeasurement, ...Measurement[]]; // @public export function collectMemoryUseData(argsIn: MemoryUseBenchmark): Promise; // @public export const currentBenchmarkMode: BenchmarkMode; // @public @input export type DurationBenchmark = DurationBenchmarkSync | DurationBenchmarkAsync | DurationBenchmarkCustom; // @public @input export interface DurationBenchmarkAsync extends BenchmarkTimingOptions { readonly benchmarkFnAsync: () => Promise; } // @public @input export interface DurationBenchmarkBatchless { readonly benchmarkFn: (state: BatchlessDurationTimer) => void | Promise; maxBenchmarkDurationSeconds?: number; minSampleCount?: number; startPhase?: Phase.CollectData | Phase.WarmUp; } // @public @input export interface DurationBenchmarkCustom extends BenchmarkTimingOptions { benchmarkFnCustom(state: BatchedDurationTimer): Promise; } // @public @input export interface DurationBenchmarkSync extends BenchmarkTimingOptions { readonly benchmarkFn: () => void; } // @public export function finishLoggingReport(reports: SuiteData, incremental: boolean, outputFilePath: string | undefined): void; // @public export function formatResultArrayTable(data: SuiteData): string | undefined; // @public export function fullName(parent: ReportPath | undefined, benchmarkName?: string): string; // @public @deprecated export const isInPerformanceTestingMode: boolean; // @public export function isResultError(result: BenchmarkResult): result is BenchmarkError; // @public export function isSuiteNode(item: ReportSuite | ReportEntry): item is ReportSuite; // @public export interface Measurement { readonly name: string; readonly significance?: Significance; readonly type?: ValueType; readonly units?: string; readonly value: number; } // @public export function memoryAddedBy>(options: MemoryUseModifier): MemoryUseBenchmark; // @public export interface MemoryUseBenchmark { benchmarkFn(state: MemoryUseCallbacks): Promise; enableAsyncGC?: boolean; keepIterations?: number; logProcessedData?: boolean; logRawData?: boolean; warmUpIterations?: number; } // @public @sealed export interface MemoryUseCallbacks { afterDeallocation(): Promise; beforeAllocation(): Promise; continue(): boolean; whileAllocated(): Promise; } // @public @input export interface MemoryUseModifier { after?(input: TIn): void | Promise; modify(input: TIn): void | Promise; setup(): TIn | Promise; } // @public export function memoryUseOfValue>(factory: () => TOut | Promise): MemoryUseBenchmark; // @public @input export interface MochaBenchmarkOptions extends BenchmarkOptions { readonly correctnessTimeoutMs?: number; readonly only?: boolean; readonly skip?: BenchmarkMode | true; } // @public export function parseBenchmarkResult(json: string): BenchmarkResult; // @public export function parseReport(text: string): unknown; // @public (undocumented) export enum Phase { // (undocumented) AdjustIterationPerBatch = 1, // (undocumented) CollectData = 2, // (undocumented) WarmUp = 0 } // @public export type PrimaryMeasurement = Required & { significance: "Primary"; }; // @public export function qualifiedTitle(args: BenchmarkDescription & Titled & { testType?: TestType | undefined; }): string; // @public export function recordTestResult(parent: ReportPath | undefined, entry: ReportEntry): void; // @public export type ReportArray = (ReportSuite | ReportEntry)[]; // @public export interface ReportEntry { // (undocumented) readonly benchmarkName: string; // (undocumented) readonly data: BenchmarkResult; } // @public export interface ReportPath { // (undocumented) readonly parent?: ReportPath; // (undocumented) readonly report: Pick; } // @public export interface ReportSuite { // (undocumented) readonly contents: ReportArray; // (undocumented) readonly suiteName: string; } // @public export interface ReportSuiteWithPath extends ReportPath { // (undocumented) readonly parent?: ReportPath; // (undocumented) readonly report: ReportSuite; } // @public export function runBenchmarkSync(args: DurationBenchmarkSync): CollectedData; // @public export type Significance = "Primary" | "Secondary" | "Diagnostic"; // @public export interface SuiteData { // (undocumented) content: ReportArray; // (undocumented) parent?: ReportPath; } // @public export enum TestType { ExecutionTime = 0, MemoryUsage = 1 } // @public export interface Timer { now(): T; toSeconds(before: T, after: T): number; } // @public export const timer: Timer; // @public @input export interface Titled { readonly title: string; } // @public export enum ValueType { // (undocumented) LargerIsBetter = "LargerIsBetter", // (undocumented) SmallerIsBetter = "SmallerIsBetter" } // @public export function visitSuitesArray(report: SuiteData, callback: (data: SuiteData) => void): void; ```