Skip to content

Commit

Permalink
Fixup for vCPU metrics as libvirt reports nanoseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
frittentheke committed Feb 23, 2024
1 parent 1884851 commit 1db6fa3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/exporter/prometheus-libvirt-exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,21 +666,21 @@ func CollectDomainVCPUInfo(ch chan<- prometheus.Metric, l *libvirt.Libvirt, doma
ch <- prometheus.MustNewConstMetric(
libvirtDomainVCPUStatsTime,
prometheus.CounterValue,
float64(metric_value),
float64(metric_value)/1e9,
promVCPULabels...)
case "wait":
metric_value := param.Value.I.(uint64)
ch <- prometheus.MustNewConstMetric(
libvirtDomainVCPUStatsWait,
prometheus.CounterValue,
float64(metric_value),
float64(metric_value)/1e9,
promVCPULabels...)
case "delay":
metric_value := param.Value.I.(uint64)
ch <- prometheus.MustNewConstMetric(
libvirtDomainVCPUStatsDelay,
prometheus.CounterValue,
float64(metric_value),
float64(metric_value)/1e9,
promVCPULabels...)
}
}
Expand Down

0 comments on commit 1db6fa3

Please sign in to comment.