| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package powervault |
| 4 | |
| 5 | func (c *Collector) collectControllerStats() { |
| 6 | stats, err := c.client.ControllerStatistics() |
| 7 | if err != nil { |
| 8 | c.Warningf("error collecting controller statistics: %v", err) |
| 9 | return |
| 10 | } |
| 11 | |
| 12 | for _, s := range stats { |
| 13 | id := s.DurableID |
| 14 | c.mx.controller.iops.WithLabelValues(id).Observe(float64(s.IOPS)) |
| 15 | c.mx.controller.throughput.WithLabelValues(id).Observe(float64(s.BytesPerSecond)) |
| 16 | c.mx.controller.cpuLoad.WithLabelValues(id).Observe(s.CPULoad) |
| 17 | c.mx.controller.writeCacheUsed.WithLabelValues(id).Observe(float64(s.WriteCacheUsed)) |
| 18 | c.mx.controller.forwardedCmds.WithLabelValues(id).Observe(float64(s.ForwardedCmds)) |
| 19 | c.mx.controller.dataRead.WithLabelValues(id).Observe(float64(s.DataRead)) |
| 20 | c.mx.controller.dataWritten.WithLabelValues(id).Observe(float64(s.DataWritten)) |
| 21 | c.mx.controller.readOps.WithLabelValues(id).Observe(float64(s.NumReads)) |
| 22 | c.mx.controller.writeOps.WithLabelValues(id).Observe(float64(s.NumWrites)) |
| 23 | c.mx.controller.writeCacheHits.WithLabelValues(id).Observe(float64(s.WriteCacheHits)) |
| 24 | c.mx.controller.writeCacheMisses.WithLabelValues(id).Observe(float64(s.WriteCacheMisses)) |
| 25 | c.mx.controller.readCacheHits.WithLabelValues(id).Observe(float64(s.ReadCacheHits)) |
| 26 | c.mx.controller.readCacheMisses.WithLabelValues(id).Observe(float64(s.ReadCacheMisses)) |
| 27 | } |
| 28 | } |