/** * Resource inspector: find running Elyra instances and their child * processes (language servers, headless browsers), with age, CPU time, * and memory - so "Elyra uses a lot of memory" reports turn into data. * * All parsing is pure and unit-tested; the only side effect (running `ps`) * lives in the CLI layer. */ export interface ProcessRecord { pid: number; ppid: number; /** Elapsed wall-clock seconds since the process started. */ elapsedSeconds: number; /** Accumulated CPU seconds. */ cpuSeconds: number; /** Resident set size in KB. */ rssKb: number; command: string; } export interface ElyraInstance { process: ProcessRecord; children: ProcessRecord[]; /** RSS of the instance plus all children, in KB. */ totalRssKb: number; warnings: string[]; } /** Parse `ps` etime format: [[dd-]hh:]mm:ss */ export declare function parseElapsed(value: string): number; /** Parse `ps` cputime format: [[dd-]hh:]mm:ss(.fraction) */ export declare function parseCpuTime(value: string): number; /** * Parse `ps axo pid=,ppid=,etime=,time=,rss=,command=` output. * The first five fields are fixed-position tokens; the rest is the command. */ export declare function parsePsOutput(output: string): ProcessRecord[]; /** * Does this command line look like a running Elyra agent? * Matches the global bin (`elyra`), dist (`@elyracode/coding-agent/dist/cli.js`), * and from-source (`coding-agent/src/cli.ts`) forms, while excluding other * Elyra-branded apps (elyra-conductor, Elyra.app) and this very inspector. */ export declare function isElyraCommand(command: string): boolean; /** Human label for a known child process, or undefined for uninteresting ones. */ export declare function classifyChild(command: string): string | undefined; export declare function findElyraInstances(records: ProcessRecord[], selfPid: number): ElyraInstance[]; export declare function formatMb(kb: number): string; export declare function formatDuration(seconds: number): string; export declare function formatResourceReport(instances: ElyraInstance[]): string; //# sourceMappingURL=resource-inspector.d.ts.map