/** * @fileoverview Memory profiler for fitness checks * * Always-on, low-overhead memory tracking for check execution. * Collects per-check profiles for trending analysis. */ /** Memory usage profile recorded for a single check execution */ export interface CheckMemoryProfile { readonly checkId: string; readonly memoryBeforeMB: number; readonly memoryAfterMB: number; readonly memoryDeltaMB: number; readonly violationCount: number; readonly durationMs: number; } /** Aggregated memory profiling summary across all check executions */ interface MemoryProfileSummary { readonly prewarmMemoryMB: number; readonly peakMemoryMB: number; readonly checksExceedingThreshold: number; readonly topConsumers: readonly CheckMemoryProfile[]; readonly allProfiles: readonly CheckMemoryProfile[]; } /** Low-overhead memory profiler that tracks per-check heap usage during fitness runs */ export declare class MemoryProfiler { private readonly profiles; private prewarmMemoryMB; private peakMemoryMB; private readonly warningThresholdMB; constructor(warningThresholdMB?: number); private takeSnapshot; private bytesToMB; /** Record memory baseline after cache prewarm completes */ recordPrewarmComplete(): void; /** Return current heap usage in megabytes */ getCurrentMemoryMB(): number; /** Record memory before a check starts; returns the pre-check heap in MB */ recordCheckStart(): number; /** Record memory after a check completes and return the check's memory profile */ recordCheckComplete(checkId: string, memoryBeforeMB: number, violationCount: number, durationMs: number): CheckMemoryProfile; /** Check whether a memory delta exceeds the configured warning threshold */ exceedsThreshold(deltaMB: number): boolean; /** Return the configured warning threshold in megabytes */ getWarningThresholdMB(): number; /** Build and return an aggregated summary of all recorded check profiles */ getSummary(): MemoryProfileSummary; /** Reset all recorded profiles and counters */ reset(): void; } export {}; //# sourceMappingURL=memory-profiler.d.ts.map