Add exec_boot_time for freebsd, dragonfly
Adds new sysctl type, bsdSysctlTypeStructTimeval to enable parsing of timevals from raw memory.
This commit is contained in:
parent
266f0958d2
commit
db8ec9c6b4
3 changed files with 61 additions and 7 deletions
|
|
@ -39,6 +39,9 @@ func NewExecCollector() (Collector, error) {
|
|||
// vm.stats.sys.v_intr: Device interrupts
|
||||
// vm.stats.sys.v_soft: Software interrupts
|
||||
// vm.stats.vm.v_forks: Number of fork() calls
|
||||
//
|
||||
// From sys/kern/kern_tc.c:
|
||||
// kern.boottime is an S,timeval
|
||||
|
||||
return &execCollector{
|
||||
sysctls: []bsdSysctl{
|
||||
|
|
@ -72,6 +75,12 @@ func NewExecCollector() (Collector, error) {
|
|||
description: "Number of fork() calls since system boot. Resets at architeture unsigned integer.",
|
||||
mib: "vm.stats.vm.v_forks",
|
||||
},
|
||||
{
|
||||
name: "boot_time",
|
||||
description: "Unix time of last boot, including microseconds.",
|
||||
mib: "kern.boottime",
|
||||
dataType: bsdSysctlTypeStructTimeval,
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue