/** * Transform statistics tracking * * Tracks per-file metrics and computes aggregate statistics including * timing breakdown and percentiles for consistent comparison across * Vite and Webpack implementations. * * @module @domscribe/transform/core/stats */ import type { ManifestWriterStats } from '@domscribe/manifest'; import type { FileMetrics, AggregateMetrics } from './types.js'; /** * Statistics tracker for transform operations * * Records per-file metrics and computes aggregate statistics * including timing breakdown and percentiles. * * @example * ```typescript * const stats = new TransformStats(); * * // Record file metrics * stats.record({ * file: 'src/App.tsx', * timings: { parseMs: 2.5, traversalMs: 0.5, ... }, * counts: { elementsFound: 10, elementsInjected: 10 }, * }); * * // Get aggregate statistics * const aggregate = stats.getAggregate(); * * // Print formatted output * stats.print('vite-plugin', managerStats); * ``` */ export declare class TransformStats { private static instances; private files; /** * Get or create a singleton TransformStats instance for a workspace. */ static getInstance(workspaceRoot: string): TransformStats; /** * Record metrics for a single file transform */ record(metrics: FileMetrics): void; /** * Get aggregate statistics from all recorded file metrics */ getAggregate(): AggregateMetrics; /** * Get all recorded file metrics */ getFileMetrics(): readonly FileMetrics[]; /** * Reset all recorded metrics */ reset(): void; /** * Print formatted statistics to console */ print(prefix: string, writerStats?: ManifestWriterStats | null): void; private percentile; private empty; } //# sourceMappingURL=stats.d.ts.map