mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 23:19:06 +01:00
Fix format for cpustat collector
This commit is contained in:
parent
e35a9f6b86
commit
e8b2bbdae1
@ -51,13 +51,13 @@ func (m *CpustatCollector) Read(interval time.Duration) {
|
||||
|
||||
ll := strings.Split(string(buffer), "\n")
|
||||
for _, line := range ll {
|
||||
if (len(line) == 0) {
|
||||
if len(line) == 0 {
|
||||
continue
|
||||
}
|
||||
ls := strings.Fields(line)
|
||||
if (strings.Compare(ls[0], "cpu") == 0) {
|
||||
if strings.Compare(ls[0], "cpu") == 0 {
|
||||
ParseStatLine(line, m.node)
|
||||
} else if (strings.HasPrefix(ls[0], "cpu")) {
|
||||
} else if strings.HasPrefix(ls[0], "cpu") {
|
||||
cpustr := strings.TrimLeft(ls[0], "cpu")
|
||||
cpu, _ := strconv.Atoi(cpustr)
|
||||
ParseStatLine(line, m.cpus[cpu])
|
||||
|
Loading…
Reference in New Issue
Block a user