Fix format

This commit is contained in:
Thomas Roehl 2021-10-04 15:47:03 +02:00
parent b06572c865
commit 486df91a9d
8 changed files with 33 additions and 33 deletions

View File

@ -69,6 +69,6 @@ func (m *CpustatCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
} }
func (m *CpustatCollector) Close() { func (m *CpustatCollector) Close() {
m.init = false m.init = false
return return
} }

View File

@ -24,7 +24,7 @@ func (m *InfinibandCollector) Init() error {
m.tags = map[string]string{"type": "node"} m.tags = map[string]string{"type": "node"}
_, err := ioutil.ReadFile(string(LIDFILE)) _, err := ioutil.ReadFile(string(LIDFILE))
if err == nil { if err == nil {
m.init = true m.init = true
} }
return err return err
} }
@ -74,6 +74,6 @@ func (m *InfinibandCollector) Read(interval time.Duration, out *[]lp.MutableMetr
} }
func (m *InfinibandCollector) Close() { func (m *InfinibandCollector) Close() {
m.init = false m.init = false
return return
} }

View File

@ -58,6 +58,6 @@ func (m *LoadavgCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
} }
func (m *LoadavgCollector) Close() { func (m *LoadavgCollector) Close() {
m.init = false m.init = false
return return
} }

View File

@ -31,7 +31,7 @@ func (m *LustreCollector) Init() error {
"inode_permission": {"inode_permission": 1}} "inode_permission": {"inode_permission": 1}}
_, err := ioutil.ReadFile(string(LUSTREFILE)) _, err := ioutil.ReadFile(string(LUSTREFILE))
if err == nil { if err == nil {
m.init = true m.init = true
} }
return err return err
} }
@ -65,6 +65,6 @@ func (m *LustreCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
} }
func (m *LustreCollector) Close() { func (m *LustreCollector) Close() {
m.init = false m.init = false
return return
} }

View File

@ -36,8 +36,8 @@ func (m *MemstatCollector) Init() error {
m.setup() m.setup()
_, err := ioutil.ReadFile(string(MEMSTATFILE)) _, err := ioutil.ReadFile(string(MEMSTATFILE))
if err == nil { if err == nil {
m.init = true m.init = true
} }
return nil return nil
} }
@ -97,6 +97,6 @@ func (m *MemstatCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
} }
func (m *MemstatCollector) Close() { func (m *MemstatCollector) Close() {
m.init = false m.init = false
return return
} }

View File

@ -14,17 +14,17 @@ type MetricGetter interface {
Init() error Init() error
Read(time.Duration, *[]lp.MutableMetric) Read(time.Duration, *[]lp.MutableMetric)
Close() Close()
// GetNodeMetric() map[string]interface{} // GetNodeMetric() map[string]interface{}
// GetSocketMetrics() map[int]map[string]interface{} // GetSocketMetrics() map[int]map[string]interface{}
// GetCpuMetrics() map[int]map[string]interface{} // GetCpuMetrics() map[int]map[string]interface{}
} }
type MetricCollector struct { type MetricCollector struct {
name string name string
init bool init bool
// node map[string]interface{} // node map[string]interface{}
// sockets map[int]map[string]interface{} // sockets map[int]map[string]interface{}
// cpus map[int]map[string]interface{} // cpus map[int]map[string]interface{}
} }
func (c *MetricCollector) Name() string { func (c *MetricCollector) Name() string {
@ -44,17 +44,17 @@ func (c *MetricCollector) Name() string {
//} //}
func (c *MetricCollector) setup() error { func (c *MetricCollector) setup() error {
// slist := SocketList() // slist := SocketList()
// clist := CpuList() // clist := CpuList()
// c.node = make(map[string]interface{}) // c.node = make(map[string]interface{})
// c.sockets = make(map[int]map[string]interface{}, len(slist)) // c.sockets = make(map[int]map[string]interface{}, len(slist))
// for _, s := range slist { // for _, s := range slist {
// c.sockets[s] = make(map[string]interface{}) // c.sockets[s] = make(map[string]interface{})
// } // }
// c.cpus = make(map[int]map[string]interface{}, len(clist)) // c.cpus = make(map[int]map[string]interface{}, len(clist))
// for _, s := range clist { // for _, s := range clist {
// c.cpus[s] = make(map[string]interface{}) // c.cpus[s] = make(map[string]interface{})
// } // }
return nil return nil
} }

View File

@ -29,8 +29,8 @@ func (m *NetstatCollector) Init() error {
} }
_, err := ioutil.ReadFile(string(NETSTATFILE)) _, err := ioutil.ReadFile(string(NETSTATFILE))
if err == nil { if err == nil {
m.init = true m.init = true
} }
return nil return nil
} }
@ -65,6 +65,6 @@ func (m *NetstatCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
} }
func (m *NetstatCollector) Close() { func (m *NetstatCollector) Close() {
m.init = false m.init = false
return return
} }

View File

@ -24,7 +24,7 @@ func (m *TopProcsCollector) Init() error {
command.Wait() command.Wait()
_, err := command.Output() _, err := command.Output()
if err == nil { if err == nil {
m.init = true m.init = true
} }
return nil return nil
} }
@ -49,6 +49,6 @@ func (m *TopProcsCollector) Read(interval time.Duration, out *[]lp.MutableMetric
} }
func (m *TopProcsCollector) Close() { func (m *TopProcsCollector) Close() {
m.init = false m.init = false
return return
} }