aboutsummaryrefslogtreecommitdiff
path: root/collector/diskstats_openbsd.go
diff options
context:
space:
mode:
authorBen Ye <yb532204897@gmail.com>2019-12-31 11:19:37 -0500
committerBen Kochie <superq@gmail.com>2019-12-31 17:19:37 +0100
commit2477c5c67dff7e7655a9d466450235e9c9eac193 (patch)
tree198cb44d48f454df765984bc614e1b1972a646e8 /collector/diskstats_openbsd.go
parenta80b7d0bc5ee93e704bab22e7592ed8b7d65899e (diff)
downloadprometheus_node_collector-2477c5c67dff7e7655a9d466450235e9c9eac193.tar.bz2
prometheus_node_collector-2477c5c67dff7e7655a9d466450235e9c9eac193.tar.xz
prometheus_node_collector-2477c5c67dff7e7655a9d466450235e9c9eac193.zip
switch to go-kit/log (#1575)
Signed-off-by: yeya24 <yb532204897@gmail.com>
Diffstat (limited to 'collector/diskstats_openbsd.go')
-rw-r--r--collector/diskstats_openbsd.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/collector/diskstats_openbsd.go b/collector/diskstats_openbsd.go
index f17e2a8..3385f37 100644
--- a/collector/diskstats_openbsd.go
+++ b/collector/diskstats_openbsd.go
@@ -18,6 +18,7 @@ package collector
18import ( 18import (
19 "unsafe" 19 "unsafe"
20 20
21 "github.com/go-kit/kit/log"
21 "github.com/prometheus/client_golang/prometheus" 22 "github.com/prometheus/client_golang/prometheus"
22 "golang.org/x/sys/unix" 23 "golang.org/x/sys/unix"
23) 24)
@@ -34,6 +35,7 @@ type diskstatsCollector struct {
34 wxfer typedDesc 35 wxfer typedDesc
35 wbytes typedDesc 36 wbytes typedDesc
36 time typedDesc 37 time typedDesc
38 logger log.Logger
37} 39}
38 40
39func init() { 41func init() {
@@ -41,13 +43,14 @@ func init() {
41} 43}
42 44
43// NewDiskstatsCollector returns a new Collector exposing disk device stats. 45// NewDiskstatsCollector returns a new Collector exposing disk device stats.
44func NewDiskstatsCollector() (Collector, error) { 46func NewDiskstatsCollector(logger log.Logger) (Collector, error) {
45 return &diskstatsCollector{ 47 return &diskstatsCollector{
46 rxfer: typedDesc{readsCompletedDesc, prometheus.CounterValue}, 48 rxfer: typedDesc{readsCompletedDesc, prometheus.CounterValue},
47 rbytes: typedDesc{readBytesDesc, prometheus.CounterValue}, 49 rbytes: typedDesc{readBytesDesc, prometheus.CounterValue},
48 wxfer: typedDesc{writesCompletedDesc, prometheus.CounterValue}, 50 wxfer: typedDesc{writesCompletedDesc, prometheus.CounterValue},
49 wbytes: typedDesc{writtenBytesDesc, prometheus.CounterValue}, 51 wbytes: typedDesc{writtenBytesDesc, prometheus.CounterValue},
50 time: typedDesc{ioTimeSecondsDesc, prometheus.CounterValue}, 52 time: typedDesc{ioTimeSecondsDesc, prometheus.CounterValue},
53 logger: logger,
51 }, nil 54 }, nil
52} 55}
53 56