pdh: convert all raw time counter types to seconds (#2776)

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jan-Otto Kröpke
2026-10-16 22:54:44 +02:00
committed by GitHub
co-authored by Claude
parent a9d5bbef48
commit da7bebc6b3
23 changed files with 313 additions and 246 deletions
@@ -205,19 +205,20 @@ func (c *Collector) publishVirtualStorageDevice(ch chan<- prometheus.Metric, scr
data.Name,
)
// The raw value of a PERF_AVERAGE_TIMER counter is the sum of all IO latencies in
// 100ns ticks; the operation count it is averaged over is Throughput.
// The value of a PERF_AVERAGE_TIMER counter is the sum of all IO latencies,
// converted to seconds by internal/pdh; the operation count it is averaged
// over is Throughput.
ch <- scrape.MustNewConstMetric(
c.virtualStorageDeviceIOLatency,
prometheus.CounterValue,
data.VirtualStorageDeviceLatency*pdh.TicksToSecondScaleFactor,
data.VirtualStorageDeviceLatency,
data.Name,
)
ch <- scrape.MustNewConstMetric(
c.virtualStorageDeviceLowerIOLatency,
prometheus.CounterValue,
data.VirtualStorageDeviceLowerLatency*pdh.TicksToSecondScaleFactor,
data.VirtualStorageDeviceLowerLatency,
data.Name,
)
}