Make metrics better follow guidelines (#787)
* Improve stat linux metric names.
cpu is no longer used.
* node_cpu -> node_cpu_seconds_total for Linux
* Improve filesystem metric names with units
* Improve units and names of linux disk stats
Remove sector metrics, the bytes metrics cover those already.
* Infiniband counters should end in _total
* Improve timex metric names, convert to more normal units.
See
3c073991eb/kernel/time/ntp.c (L909)
for what stabil means, looks like a moving average of some form.
* Update test fixture
* For meminfo metrics that had "kB" units, add _bytes
* Interrupts counter should have _total
This commit is contained in:
parent
b4d7ba119a
commit
a98067a294
12 changed files with 547 additions and 604 deletions
|
|
@ -47,19 +47,19 @@ func (c *meminfoCollector) getMemInfo() (map[string]float64, error) {
|
|||
return nil, fmt.Errorf("sysctl CTL_VM VM_UVMEXP failed: %v", err)
|
||||
}
|
||||
|
||||
ps := float64(uvmexp.pagesize)
|
||||
ps := float64(uvmexp.pagesize)
|
||||
|
||||
// see uvm(9)
|
||||
return map[string]float64{
|
||||
"active_bytes": ps * float64(uvmexp.active),
|
||||
"cache_bytes": ps * float64(uvmexp.vnodepages),
|
||||
"free_bytes": ps * float64(uvmexp.free),
|
||||
"inactive_bytes": ps * float64(uvmexp.inactive),
|
||||
"size_bytes": ps * float64(uvmexp.npages),
|
||||
"swap_size_bytes": ps * float64(uvmexp.swpages),
|
||||
"swap_used_bytes": ps * float64(uvmexp.swpgonly),
|
||||
"swapped_in_pages_bytes_total": ps * float64(uvmexp.pgswapin),
|
||||
"swapped_out_pages_bytes_total": ps * float64(uvmexp.pgswapout),
|
||||
"wired_bytes": ps * float64(uvmexp.wired),
|
||||
"active_bytes": ps * float64(uvmexp.active),
|
||||
"cache_bytes": ps * float64(uvmexp.vnodepages),
|
||||
"free_bytes": ps * float64(uvmexp.free),
|
||||
"inactive_bytes": ps * float64(uvmexp.inactive),
|
||||
"size_bytes": ps * float64(uvmexp.npages),
|
||||
"swap_size_bytes": ps * float64(uvmexp.swpages),
|
||||
"swap_used_bytes": ps * float64(uvmexp.swpgonly),
|
||||
"swapped_in_pages_bytes_total": ps * float64(uvmexp.pgswapin),
|
||||
"swapped_out_pages_bytes_total": ps * float64(uvmexp.pgswapout),
|
||||
"wired_bytes": ps * float64(uvmexp.wired),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue