From 31e1a0903e0348b0e7ffc23f120d3e959135bb4c Mon Sep 17 00:00:00 2001 From: Brian Martin Date: Fri, 18 Jun 2021 11:02:47 -0700 Subject: [PATCH] bugfix: interrupts sampler per-node nvme and network metrics (#226) As noted in #224, we improperly initialize the per-node interrupt counts with the sum for both node0 and node1. This results in incorrect values for nvme and network interrupt counts per-node. --- src/samplers/interrupt/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/samplers/interrupt/mod.rs b/src/samplers/interrupt/mod.rs index 76f4c9f0..bc8cd7f2 100644 --- a/src/samplers/interrupt/mod.rs +++ b/src/samplers/interrupt/mod.rs @@ -216,12 +216,12 @@ impl Interrupt { if let Some(previous) = result.get_mut(&InterruptStatistic::Node0Nvme) { *previous += node0; } else { - result.insert(InterruptStatistic::Node0Nvme, sum); + result.insert(InterruptStatistic::Node0Nvme, node0); } if let Some(previous) = result.get_mut(&InterruptStatistic::Node1Nvme) { *previous += node1; } else { - result.insert(InterruptStatistic::Node1Nvme, sum); + result.insert(InterruptStatistic::Node1Nvme, node1); } InterruptStatistic::Nvme } @@ -232,14 +232,14 @@ impl Interrupt { { *previous += node0; } else { - result.insert(InterruptStatistic::Node0Network, sum); + result.insert(InterruptStatistic::Node0Network, node0); } if let Some(previous) = result.get_mut(&InterruptStatistic::Node1Network) { *previous += node1; } else { - result.insert(InterruptStatistic::Node1Network, sum); + result.insert(InterruptStatistic::Node1Network, node1); } InterruptStatistic::Network } else if label.starts_with("nvme") { @@ -248,14 +248,14 @@ impl Interrupt { { *previous += node0; } else { - result.insert(InterruptStatistic::Node0Nvme, sum); + result.insert(InterruptStatistic::Node0Nvme, node0); } if let Some(previous) = result.get_mut(&InterruptStatistic::Node1Nvme) { *previous += node1; } else { - result.insert(InterruptStatistic::Node1Nvme, sum); + result.insert(InterruptStatistic::Node1Nvme, node1); } InterruptStatistic::Nvme } else {