adjustments for dependency mgmt
This commit is contained in:
parent
812101c8b1
commit
c8dd5f281c
|
@ -54,6 +54,7 @@ I/O related measurement names:
|
|||
|
||||
CPU related measurement names:
|
||||
- procstat_[prefix_]cpu_user value=0
|
||||
- procstat_[prefix_]cpu_percent value=0.0
|
||||
- procstat_[prefix_]cpu_system value=0.01
|
||||
- procstat_[prefix_]cpu_idle value=0
|
||||
- procstat_[prefix_]cpu_nice value=0
|
||||
|
|
|
@ -38,7 +38,7 @@ func NewSpecProcessor(
|
|||
var cores int32
|
||||
|
||||
func init() {
|
||||
if info, err := cpu.Info(); err == nil {
|
||||
if info, err := cpu.CPUInfo(); err == nil {
|
||||
for _, in := range info {
|
||||
cores += in.Cores
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ func (p *SpecProcessor) pushMetrics() {
|
|||
fields[prefix+"write_bytes"] = io.WriteCount
|
||||
}
|
||||
|
||||
cpu_time, err := p.proc.Times()
|
||||
cpu_time, err := p.proc.CPUTimes()
|
||||
if err == nil {
|
||||
fields[prefix+"cpu_time_user"] = cpu_time.User
|
||||
fields[prefix+"cpu_time_system"] = cpu_time.System
|
||||
|
@ -91,7 +91,7 @@ func (p *SpecProcessor) pushMetrics() {
|
|||
fields[prefix+"cpu_time_guest_nice"] = cpu_time.GuestNice
|
||||
}
|
||||
|
||||
cpu_perc, err := p.proc.Percent(time.Duration(0))
|
||||
cpu_perc, err := p.proc.CPUPercent(time.Duration(0))
|
||||
if err == nil && cpu_perc != 0 {
|
||||
fields[prefix+"cpu_usage"] = cpu_perc
|
||||
if cores > 0 {
|
||||
|
|
Loading…
Reference in New Issue