/** * QVAC SDK Profiler * * @example * ```ts * import { profiler } from "@qvac/sdk"; * * profiler.enable({ mode: "summary" }); * // ... run SDK operations ... * console.log(profiler.exportTable()); * profiler.disable(); * ``` */ import * as controller from "./controller"; import type { ProfilerRuntimeOptions, ProfilingEvent, ProfilerExport, AggregatedStats } from "./types"; export declare const profiler: { /** * Enables profiling and resets all previously aggregated data. * * @param options - Optional runtime options (profiling mode, server breakdown, operation filters, ring-buffer capacity). */ enable: (options?: ProfilerRuntimeOptions) => void; /** * Disables profiling. New SDK operations will no longer be recorded. */ disable: () => void; /** * Returns whether profiling is currently enabled. * * @returns `true` when profiling is currently enabled, `false` otherwise. */ isEnabled: () => boolean; /** * Exports profiling data as a structured JSON object suitable for machine consumption. * * @param options - Export options. * @param options.includeRecentEvents - When `true`, includes the ring buffer of recent events in the export (only populated when profiler was enabled in `"verbose"` mode). * @returns A `ProfilerExport` snapshot of aggregated stats and (optionally) recent events. */ exportJSON: (options?: { includeRecentEvents?: boolean; }) => ProfilerExport; /** * Exports aggregated stats as a formatted ASCII table suitable for terminal output. * * @returns A multi-line string rendering of the aggregated stats table. */ exportTable: () => string; /** * Exports a short, human-readable summary string of the aggregated stats. * * @returns A one-paragraph summary of the profiling data. */ exportSummary: () => string; /** * Registers a listener for profiling events; returns an unsubscribe function. * * @param callback - Invoked once per recorded profiling event. * @returns An unsubscribe function; call it to remove the listener. */ onRecord: (callback: (event: ProfilingEvent) => void) => () => void; /** * Returns the current effective profiler configuration. * * @returns The effective `ResolvedProfilerConfig` (defaults merged with user overrides). */ getConfig: () => controller.ResolvedProfilerConfig; /** * Returns all aggregated stats keyed by operation name. * * @returns A record of `AggregatedStats` keyed by operation name. */ getAggregates: () => Record; /** * Clears all aggregated data and the recent-events ring buffer. */ clear: () => void; }; export type { ProfilerRuntimeOptions, ProfilingEvent, ProfilerExport, AggregatedStats, ProfilingEventKind, } from "./types"; export type { ProfilerMode } from "../schemas/index"; export { nowMs } from "./clock"; export { record, shouldProfile, shouldIncludeServerBreakdown, generateId, isEnabled, type ResolvedProfilerConfig, } from "./controller"; export { createProfilingMeta, createProfilingDisabledMeta, injectProfilingMetaIntoObject, extractProfilingMeta, stripProfilingMeta, } from "./envelope"; export { recordPhase, recordFailure, recordServerBreakdownPhases, recordDelegationBreakdownPhases, type BaseTimings, type BaseEvent, } from "./events"; //# sourceMappingURL=index.d.ts.map