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
|
|
@ -18,6 +18,7 @@ package collector
|
|||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-kit/kit/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
|
@ -34,6 +35,7 @@ type diskstatsCollector struct {
|
|||
wxfer typedDesc
|
||||
wbytes typedDesc
|
||||
time typedDesc
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
@ -41,13 +43,14 @@ func init() {
|
|||
}
|
||||
|
||||
// NewDiskstatsCollector returns a new Collector exposing disk device stats.
|
||||
func NewDiskstatsCollector() (Collector, error) {
|
||||
func NewDiskstatsCollector(logger log.Logger) (Collector, error) {
|
||||
return &diskstatsCollector{
|
||||
rxfer: typedDesc{readsCompletedDesc, prometheus.CounterValue},
|
||||
rbytes: typedDesc{readBytesDesc, prometheus.CounterValue},
|
||||
wxfer: typedDesc{writesCompletedDesc, prometheus.CounterValue},
|
||||
wbytes: typedDesc{writtenBytesDesc, prometheus.CounterValue},
|
||||
time: typedDesc{ioTimeSecondsDesc, prometheus.CounterValue},
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue