Skip to content

Commit

Permalink
Substruct cpu.guest from cpu.user on Linux (ref: #419)
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Oct 16, 2017
1 parent e0bd308 commit ca7155b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions metrics/linux/cpuusage.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,10 @@ func (g *CPUUsageGenerator) collectProcStatValues() ([]float64, float64, uint, e
totalValues += values[i]
}

// cpu.user includes cpu.guest so substruct guest from user
// https://github.com/mackerelio/mackerel-agent/issues/419
values[0] -= values[8]
totalValues -= values[8]

return values, totalValues, cpuCount, nil
}

0 comments on commit ca7155b

Please sign in to comment.