/** * Forces garbage collection. A single pass is not enough to settle the heap; * phase-0 measurements used 3 passes separated by event-loop ticks so that * finalizers and pending callbacks can release references between passes. * Returns false when the process was not started with `--expose-gc`. */ export declare function forceGc(passes?: number): Promise; export type HeapSample = { gcExposed: boolean; heapUsed: number; rss: number; external: number; arrayBuffers: number; /** * Identity of the process that produced this sample. Optional in the type so * fixtures stay readable; the wire schema in `control-client.ts` requires it, * so a real sample always carries it. */ pid?: number; ppid?: number; argv?: readonly string[]; cwd?: string; /** * HTTP requests this process has served since boot, counted by the probe in * `bootstrap.ts`. Recorded as evidence of how much traffic reached the * process behind a reading, not checked anywhere: a clustered server counts * in whichever process took the connection. `undefined` when the probe was * not installed. */ servedRequests?: number | undefined; }; /** Where `bootstrap.ts` publishes the served-request count. */ export declare const requestProbe: typeof globalThis & { __nextLeakServedRequests?: number; }; export type ControlServerOptions = { /** Directory where heap snapshots are written. */ snapshotDir: string; /** Injectable for tests; defaults to `v8.writeHeapSnapshot`. */ writeSnapshot?: (file: string) => string; }; export type ControlServer = { port: number; close: () => Promise; }; /** * Internal control channel booted inside the measured app's process. * * - `GET /gc` — force GC, respond with a memory sample. * - `GET /mem` — respond with a memory sample WITHOUT collecting. * - `GET /snapshot?name=