@@ -5,8 +5,8 @@ package collector
55import (
66 "errors"
77
8- "github.com/golang/glog"
98 "github.com/prometheus/client_golang/prometheus"
9+ "github.com/prometheus/log"
1010)
1111
1212/*
@@ -40,7 +40,8 @@ func init() {
4040 Factories ["meminfo" ] = NewMeminfoCollector
4141}
4242
43- // memory stats.
43+ // Takes a prometheus registry and returns a new Collector exposing
44+ // Memory stats.
4445func NewMeminfoCollector () (Collector , error ) {
4546 return & meminfoCollector {
4647 metrics : map [string ]prometheus.Gauge {},
@@ -77,7 +78,7 @@ func (c *meminfoCollector) Update(ch chan<- prometheus.Metric) (err error) {
7778 }
7879 }
7980
80- glog . V ( 1 ). Infof ("Set node_mem: %#v" , pages )
81+ log . Debugf ("Set node_mem: %#v" , pages )
8182 for k , v := range pages {
8283 if _ , ok := c .metrics [k ]; ! ok {
8384 c .metrics [k ] = prometheus .NewGauge (prometheus.GaugeOpts {
@@ -87,7 +88,7 @@ func (c *meminfoCollector) Update(ch chan<- prometheus.Metric) (err error) {
8788 Help : k + " from sysctl()" ,
8889 })
8990 }
90- // Convert metrics to kB ( same as Linux meminfo)
91+ // Convert metrics to kB ( same as Linux meminfo).
9192 c .metrics [k ].Set (float64 (v ) * float64 (size ))
9293 c .metrics [k ].Collect (ch )
9394 }
0 commit comments