| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package powervault |
| 4 | |
| 5 | func (c *Collector) collectVolumeStats() { |
| 6 | stats, err := c.client.VolumeStatistics() |
| 7 | if err != nil { |
| 8 | c.Warningf("error collecting volume statistics: %v", err) |
| 9 | return |
| 10 | } |
| 11 | |
| 12 | for _, s := range stats { |
| 13 | name := s.VolumeName |
| 14 | if !c.volumeMatches(name) { |
| 15 | continue |
| 16 | } |
| 17 | c.mx.volume.iops.WithLabelValues(name).Observe(float64(s.IOPS)) |
| 18 | c.mx.volume.throughput.WithLabelValues(name).Observe(float64(s.BytesPerSecond)) |
| 19 | c.mx.volume.writeCachePercent.WithLabelValues(name).Observe(float64(s.WriteCachePercent)) |
| 20 | c.mx.volume.dataRead.WithLabelValues(name).Observe(float64(s.DataRead)) |
| 21 | c.mx.volume.dataWritten.WithLabelValues(name).Observe(float64(s.DataWritten)) |
| 22 | c.mx.volume.readOps.WithLabelValues(name).Observe(float64(s.NumReads)) |
| 23 | c.mx.volume.writeOps.WithLabelValues(name).Observe(float64(s.NumWrites)) |
| 24 | c.mx.volume.writeCacheHits.WithLabelValues(name).Observe(float64(s.WriteCacheHits)) |
| 25 | c.mx.volume.writeCacheMisses.WithLabelValues(name).Observe(float64(s.WriteCacheMisses)) |
| 26 | c.mx.volume.readCacheHits.WithLabelValues(name).Observe(float64(s.ReadCacheHits)) |
| 27 | c.mx.volume.readCacheMisses.WithLabelValues(name).Observe(float64(s.ReadCacheMisses)) |
| 28 | c.mx.volume.tierSSD.WithLabelValues(name).Observe(float64(s.TierSSD)) |
| 29 | c.mx.volume.tierSAS.WithLabelValues(name).Observe(float64(s.TierSAS)) |
| 30 | c.mx.volume.tierSATA.WithLabelValues(name).Observe(float64(s.TierSATA)) |
| 31 | } |
| 32 | } |