[Backport release-mainnet-1.2.0-rc] fix(process-metrics): build on non-Linux platforms#4439
Conversation
* fix(process-metrics): build on non-Linux platforms - Gate procfs dependency to cfg(target_os = "linux") so its build script no longer fails on macOS - Split into a portable ProcessMetrics (memory, cpu_count, uptime via sysinfo) and a Linux-only LinuxMetrics extension (/proc, cgroup, PSI) - Keep the only platform cfg in lib.rs; non-Linux gets an inline no-op ext * fix(process-metrics): report node_cpu_count via available_parallelism - System::new().cpus() is empty until an explicit CPU refresh, so the gauge reported 0; use std::thread::available_parallelism instead - Extract cpu_count and process_memory as pure functions with regression tests asserting non-zero CPU and memory readings (cherry picked from commit 809b0a1)
Pull request was closed
|
Claude finished @sveitser's task in 1m 44s —— View job Code Review: Backport fix(process-metrics) build on non-Linux platforms
SummaryThis is a clean backport of #4435 to
FindingsThe refactor is well-structured and the backport is clean. The public API ( Bug fix:
|
Description
Backport of #4435 to
release-mainnet-1.2.0-rc.