/** * Why a limit did or did not accompany a usage reading. * * available A finite positive limit was read; `limitBytes` is set. * unlimited The cgroup reports no limit: v2 `max`, or v1's 2^63-1 sentinel * (which gVisor sandboxes always report, because the real limit * is enforced on the host cgroup outside the sandbox). * unreadable The limit file could not be read at all. * * The last two both omit `limitBytes`, so without this they are indistinguishable * to a consumer -- an unreadable limit is a genuine fault worth alerting on, * while an unlimited one is the normal steady state under gVisor. */ type CgroupLimitState = "available" | "unlimited" | "unreadable"; interface CgroupMemory { currentBytes: number; /** Set only when `limitState` is `available`. */ limitBytes?: number; /** Absent whenever `limitBytes` is, since it is derived from it. */ usageRatio?: number; /** Always set; see {@link CgroupLimitState}. */ limitState: CgroupLimitState; } export interface MemoryMetricsOptions { /** * Cgroup filesystem root to read from. Defaults to the real `/sys/fs/cgroup`; * overridden only by tests, which point it at a fixture directory. */ cgroupRoot?: string; } export declare function readCgroupMemory(root?: string): CgroupMemory | undefined; export declare function startMemoryMetrics(options?: MemoryMetricsOptions): void; export declare function stopMemoryMetrics(): void; export {}; //# sourceMappingURL=memory-metrics.d.ts.map