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() {
m.init = false
m.init = false
return
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}