MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / parseCgroupLimitMb

Function parseCgroupLimitMb

packages/engine/src/services/systemMemory.ts:32–41  ·  view source on GitHub ↗
(
  v2Content: string | null,
  v1Content: string | null,
)

Source from the content-addressed store, hash-verified

30
31/** Parse cgroup v2/v1 memory limits from sysfs file contents into MiB. */
32export function parseCgroupLimitMb(
33 v2Content: string | null,
34 v1Content: string | null,
35): number | null {
36 if (v2Content !== null) {
37 return parseCgroupV2LimitMb(v2Content);
38 }
39
40 return parseCgroupV1LimitMb(v1Content);
41}
42
43function parseCgroupV2LimitMb(content: string): number | null {
44 const trimmed = content.trim();

Callers 2

getCgroupLimitMbFunction · 0.85

Calls 2

parseCgroupV2LimitMbFunction · 0.85
parseCgroupV1LimitMbFunction · 0.85

Tested by

no test coverage detected