Skip to content

Commit

Permalink
bugfix: interrupts sampler per-node nvme and network metrics (iopsyst…
Browse files Browse the repository at this point in the history
…ems#226)

As noted in iopsystems#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.
  • Loading branch information
brayniac authored Jun 18, 2021
1 parent b5981ca commit 31e1a09
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/samplers/interrupt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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") {
Expand All @@ -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 {
Expand Down

0 comments on commit 31e1a09

Please sign in to comment.