Skip to content

Commit

Permalink
Add n_cpu field to system plugin
Browse files Browse the repository at this point in the history
closes #1041
  • Loading branch information
sparrc committed Apr 21, 2016
1 parent f1b7ecb commit c058892
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/inputs/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
"fmt"
"runtime"

"github.com/shirou/gopsutil/host"
"github.com/shirou/gopsutil/load"
Expand Down Expand Up @@ -43,6 +44,7 @@ func (_ *SystemStats) Gather(acc telegraf.Accumulator) error {
"uptime": hostinfo.Uptime,
"n_users": len(users),
"uptime_format": format_uptime(hostinfo.Uptime),
"n_cpus": runtime.NumCPU(),
}
acc.AddFields("system", fields, nil)

Expand Down

0 comments on commit c058892

Please sign in to comment.