Skip to content
Snippets Groups Projects
Unverified Commit 8252e748 authored by Angelo Capossele's avatar Angelo Capossele Committed by GitHub
Browse files

:bug: Fix bug (#905)

parent 07328450
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ func measureCPUUsage() {
// Percent calculates the percentage of cpu used either per CPU or combined.
// TODO: use func PercentWithContext for more detailed info.
percent, err := cpu.Percent(time.Second, false)
if err == nil {
if err == nil && len(percent) > 0 {
p = percent[0]
}
metrics.Events().CPUUsage.Trigger(p)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment