Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/collectors/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,18 @@ fn gather_numa_nodes() -> Vec<NumaNode> {
// Read NUMA node memory from its meminfo file.
let memory_bytes = parse_numa_meminfo(&dir.join("meminfo"));

// Each field corresponds the distance to the numa node with the appropriate index
let distances = sysfs::read_string_optional(&dir.join("distance"))
.unwrap_or_default()
.split_whitespace()
.filter_map(|s| s.parse::<u32>().ok())
.collect::<Vec<u32>>();

nodes.push(NumaNode {
node_id,
cpu_list,
memory_bytes,
distances,
});
}

Expand Down
1 change: 1 addition & 0 deletions src/model/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub struct NumaNode {
pub node_id: u32,
pub cpu_list: String,
pub memory_bytes: Option<u64>,
pub distances: Vec<u32>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
Loading