diff --git a/collectors/cpustatMetric.go b/collectors/cpustatMetric.go index 9b428b7..7593e8f 100644 --- a/collectors/cpustatMetric.go +++ b/collectors/cpustatMetric.go @@ -69,6 +69,6 @@ func (m *CpustatCollector) Read(interval time.Duration, out *[]lp.MutableMetric) } func (m *CpustatCollector) Close() { - m.init = false + m.init = false return } diff --git a/collectors/infinibandMetric.go b/collectors/infinibandMetric.go index 099bd5b..00c340c 100644 --- a/collectors/infinibandMetric.go +++ b/collectors/infinibandMetric.go @@ -24,7 +24,7 @@ func (m *InfinibandCollector) Init() error { m.tags = map[string]string{"type": "node"} _, err := ioutil.ReadFile(string(LIDFILE)) if err == nil { - m.init = true + m.init = true } return err } @@ -74,6 +74,6 @@ func (m *InfinibandCollector) Read(interval time.Duration, out *[]lp.MutableMetr } func (m *InfinibandCollector) Close() { - m.init = false + m.init = false return } diff --git a/collectors/loadavgMetric.go b/collectors/loadavgMetric.go index 4be7c87..3b91d75 100644 --- a/collectors/loadavgMetric.go +++ b/collectors/loadavgMetric.go @@ -58,6 +58,6 @@ func (m *LoadavgCollector) Read(interval time.Duration, out *[]lp.MutableMetric) } func (m *LoadavgCollector) Close() { - m.init = false + m.init = false return } diff --git a/collectors/lustreMetric.go b/collectors/lustreMetric.go index a4af598..ce52d54 100644 --- a/collectors/lustreMetric.go +++ b/collectors/lustreMetric.go @@ -31,7 +31,7 @@ func (m *LustreCollector) Init() error { "inode_permission": {"inode_permission": 1}} _, err := ioutil.ReadFile(string(LUSTREFILE)) if err == nil { - m.init = true + m.init = true } return err } @@ -65,6 +65,6 @@ func (m *LustreCollector) Read(interval time.Duration, out *[]lp.MutableMetric) } func (m *LustreCollector) Close() { - m.init = false + m.init = false return } diff --git a/collectors/memstatMetric.go b/collectors/memstatMetric.go index 5462de4..d885d44 100644 --- a/collectors/memstatMetric.go +++ b/collectors/memstatMetric.go @@ -36,8 +36,8 @@ func (m *MemstatCollector) Init() error { m.setup() _, err := ioutil.ReadFile(string(MEMSTATFILE)) if err == nil { - m.init = true - } + m.init = true + } return nil } @@ -97,6 +97,6 @@ func (m *MemstatCollector) Read(interval time.Duration, out *[]lp.MutableMetric) } func (m *MemstatCollector) Close() { - m.init = false + m.init = false return } diff --git a/collectors/metricCollector.go b/collectors/metricCollector.go index ca076dd..d05b443 100644 --- a/collectors/metricCollector.go +++ b/collectors/metricCollector.go @@ -14,17 +14,17 @@ type MetricGetter interface { Init() error Read(time.Duration, *[]lp.MutableMetric) Close() -// GetNodeMetric() map[string]interface{} -// GetSocketMetrics() map[int]map[string]interface{} -// GetCpuMetrics() map[int]map[string]interface{} + // GetNodeMetric() map[string]interface{} + // GetSocketMetrics() map[int]map[string]interface{} + // GetCpuMetrics() map[int]map[string]interface{} } type MetricCollector struct { - name string - init bool -// node map[string]interface{} -// sockets map[int]map[string]interface{} -// cpus map[int]map[string]interface{} + name string + init bool + // node map[string]interface{} + // sockets map[int]map[string]interface{} + // cpus map[int]map[string]interface{} } func (c *MetricCollector) Name() string { @@ -44,17 +44,17 @@ func (c *MetricCollector) Name() string { //} func (c *MetricCollector) setup() error { -// slist := SocketList() -// clist := CpuList() -// c.node = make(map[string]interface{}) -// c.sockets = make(map[int]map[string]interface{}, len(slist)) -// for _, s := range slist { -// c.sockets[s] = make(map[string]interface{}) -// } -// c.cpus = make(map[int]map[string]interface{}, len(clist)) -// for _, s := range clist { -// c.cpus[s] = make(map[string]interface{}) -// } + // slist := SocketList() + // clist := CpuList() + // c.node = make(map[string]interface{}) + // c.sockets = make(map[int]map[string]interface{}, len(slist)) + // for _, s := range slist { + // c.sockets[s] = make(map[string]interface{}) + // } + // c.cpus = make(map[int]map[string]interface{}, len(clist)) + // for _, s := range clist { + // c.cpus[s] = make(map[string]interface{}) + // } return nil } diff --git a/collectors/netstatMetric.go b/collectors/netstatMetric.go index 54eae47..b696f74 100644 --- a/collectors/netstatMetric.go +++ b/collectors/netstatMetric.go @@ -29,8 +29,8 @@ func (m *NetstatCollector) Init() error { } _, err := ioutil.ReadFile(string(NETSTATFILE)) if err == nil { - m.init = true - } + m.init = true + } return nil } @@ -65,6 +65,6 @@ func (m *NetstatCollector) Read(interval time.Duration, out *[]lp.MutableMetric) } func (m *NetstatCollector) Close() { - m.init = false + m.init = false return } diff --git a/collectors/topprocsMetric.go b/collectors/topprocsMetric.go index ffb2065..13f547f 100644 --- a/collectors/topprocsMetric.go +++ b/collectors/topprocsMetric.go @@ -24,7 +24,7 @@ func (m *TopProcsCollector) Init() error { command.Wait() _, err := command.Output() if err == nil { - m.init = true + m.init = true } return nil } @@ -49,6 +49,6 @@ func (m *TopProcsCollector) Read(interval time.Duration, out *[]lp.MutableMetric } func (m *TopProcsCollector) Close() { - m.init = false + m.init = false return }