switch to go-kit/log (#1575)
Signed-off-by: yeya24 <yb532204897@gmail.com>
This commit is contained in:
parent
a80b7d0bc5
commit
2477c5c67d
158 changed files with 3434 additions and 4636 deletions
|
|
@ -17,17 +17,21 @@
|
|||
package collector
|
||||
|
||||
import (
|
||||
"github.com/go-kit/kit/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
type bootTimeCollector struct{ boottime bsdSysctl }
|
||||
type bootTimeCollector struct {
|
||||
boottime bsdSysctl
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
func init() {
|
||||
registerCollector("boottime", defaultEnabled, newBootTimeCollector)
|
||||
}
|
||||
|
||||
// newBootTimeCollector returns a new Collector exposing system boot time on BSD systems.
|
||||
func newBootTimeCollector() (Collector, error) {
|
||||
func newBootTimeCollector(logger log.Logger) (Collector, error) {
|
||||
return &bootTimeCollector{
|
||||
boottime: bsdSysctl{
|
||||
name: "boot_time_seconds",
|
||||
|
|
@ -35,6 +39,7 @@ func newBootTimeCollector() (Collector, error) {
|
|||
mib: "kern.boottime",
|
||||
dataType: bsdSysctlTypeStructTimeval,
|
||||
},
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue