Skip to content

Commit

Permalink
default zeros for process types metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
identw committed May 16, 2024
1 parent 5dcd6ba commit bd1308e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/proc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,19 @@ func CountProcessTypes() (map[string]int, error) {
return nil, err
}

processTypes := make(map[string]int)
processTypes := map[string]int{
"running": 0,
"idle": 0,
"sleeping": 0,
"uninterruptible_disk_sleep": 0,
"zombie": 0,
"stopped": 0,
"tracing_stop": 0,
"dead": 0,
"wakekill": 0,
"waking": 0,
"parked": 0,
}
for _, proc := range procs {
stat, err := proc.Stat()
if err != nil {
Expand Down

0 comments on commit bd1308e

Please sign in to comment.