Skip to content

Commit 4e05f9d

Browse files
committed
fix(core): read pod cgroup limits instead of node limits in resource metrics
1 parent b3edd3d commit 4e05f9d

6 files changed

Lines changed: 1158 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/nx/Cargo.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,17 @@ static_assertions = "1.1"
7575
wrap-ansi = "0.1"
7676

7777
[target.'cfg(windows)'.dependencies]
78-
winapi = { version = "0.3", features = ["fileapi", "psapi"] }
78+
winapi = { version = "0.3", features = [
79+
"fileapi",
80+
"psapi",
81+
# Used by the metrics collector to detect Job Object CPU rate, affinity,
82+
# and memory limits — Windows analog to the Linux cgroup detection.
83+
"jobapi",
84+
"jobapi2",
85+
"processthreadsapi",
86+
"winbase",
87+
"winnt",
88+
] }
7989

8090
[target.'cfg(windows)'.build-dependencies]
8191
winres = "0.1"
@@ -92,6 +102,11 @@ uuid = "1"
92102
mio = "1.0"
93103
nix = { version = "0.30.0", features = ["fs", "process", "signal"] }
94104

105+
# Used by the metrics collector to read sched_getaffinity directly, bypassing
106+
# std::thread::available_parallelism's floor-rounded cgroup quota handling.
107+
[target.'cfg(target_os = "linux")'.dependencies]
108+
libc = "0.2"
109+
95110
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
96111
arboard = { version = "3.4.1", features = ["wayland-data-control"] }
97112
crossterm = { version = "0.29.0", features = ["event-stream", "use-dev-tty"] }

0 commit comments

Comments
 (0)