/** * SMI-632: BenchmarkRunner - Performance benchmark infrastructure * SMI-689: Enhanced with MemoryProfiler integration * SMI-1189: Refactored to use extracted modules * * Features: * - Run benchmark suites * - Measure p50, p95, p99 latencies * - Memory usage tracking with MemoryProfiler * - Memory regression detection (fail if heap grows >10% vs baseline) * - Warm-up runs before measurement * - Statistical analysis (mean, stddev) */ import { MemoryProfiler, type MemoryBaseline } from './MemoryProfiler.js'; import { type BenchmarkConfig, type BenchmarkResult, type BenchmarkReport, type BenchmarkDefinition } from './types.js'; export type { BenchmarkConfig, BenchmarkResult, BenchmarkStats, BenchmarkReport, BenchmarkDefinition, BenchmarkFn, EnvironmentInfo, MemoryStats, DetailedMemoryStats, MemoryRegressionInfo, ComparisonResult, MetricComparison, } from './types.js'; export { formatReportAsJson, formatReportAsText, formatBytes } from './formatters.js'; export { compareReports, hasRegressions, getRegressedBenchmarks, getImprovedBenchmarks, } from './comparator.js'; /** * Core benchmark runner for performance testing */ export declare class BenchmarkRunner { private config; private benchmarks; private results; /** SMI-689: Memory profiler instance */ private memoryProfiler; constructor(config?: BenchmarkConfig); /** * Get the memory profiler instance (SMI-689) */ getMemoryProfiler(): MemoryProfiler | null; /** * Add a benchmark to the suite */ add(definition: BenchmarkDefinition): this; /** * Run all benchmarks in the suite */ run(): Promise; /** * Run a single benchmark with error handling (SMI-678) */ private runBenchmark; /** * Generate a benchmark report from results */ private generateReport; /** * Calculate statistical metrics from latencies * Uses shared stats module for consistent calculations (SMI-677) * Includes empty array guard (SMI-679) and sample variance (Bessel correction) */ private calculateStats; /** * @deprecated Use shared percentile from stats.ts instead (SMI-677) * Calculate percentile value from sorted array */ private _legacyPercentile; /** * Get environment information */ private getEnvironmentInfo; /** * Detect if running in Docker */ private isDocker; /** * Force garbage collection if available */ private forceGC; /** * Get raw results */ getResults(): BenchmarkResult[]; /** * Clear all benchmarks */ clear(): void; /** * Enable memory profiler after construction (SMI-689) */ enableMemoryProfiler(baselines?: Record): void; /** * Get memory profiling report as string (SMI-689) */ getMemoryReport(): string; } //# sourceMappingURL=BenchmarkRunner.d.ts.map