master
go 16 lines 575 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 package powervault
4
5 // collectPoolCapacity reports per-pool total and available capacity.
6 // Uses cached discovery data — no API calls.
7 // Values from the API are in 512-byte blocks; we convert to bytes.
8 func (c *Collector) collectPoolCapacity() {
9 const blockSize = 512
10
11 for _, p := range c.discovered.pools {
12 name := p.Name
13 c.mx.pool.totalBytes.WithLabelValues(name).Observe(float64(p.TotalSizeNumeric * blockSize))
14 c.mx.pool.availableBytes.WithLabelValues(name).Observe(float64(p.TotalAvailNumeric * blockSize))
15 }
16 }