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
|
|
@ -19,6 +19,7 @@ import (
|
|||
"strconv"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-kit/kit/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
|
@ -30,16 +31,18 @@ import (
|
|||
import "C"
|
||||
|
||||
type cpuCollector struct {
|
||||
cpu typedDesc
|
||||
cpu typedDesc
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
func init() {
|
||||
registerCollector("cpu", defaultEnabled, NewCPUCollector)
|
||||
}
|
||||
|
||||
func NewCPUCollector() (Collector, error) {
|
||||
func NewCPUCollector(logger log.Logger) (Collector, error) {
|
||||
return &cpuCollector{
|
||||
cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue},
|
||||
cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue},
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue