fix livebox_deviceinfo_memory unit

This commit is contained in:
Tomy Guichard 2023-05-03 21:43:49 +02:00
parent ed559c5a69
commit 86d6520c62
2 changed files with 6 additions and 6 deletions

View file

@ -36,12 +36,12 @@ func NewDeviceInfo(client livebox.Client) *DeviceInfo {
nil, nil,
),
memoryTotalMetric: prometheus.NewDesc(
"livebox_deviceinfo_memory_total_mbytes",
"livebox_deviceinfo_memory_total_bytes",
"Livebox system total memory.",
nil, nil,
),
memoryUsageMetric: prometheus.NewDesc(
"livebox_deviceinfo_memory_usage_mbytes",
"livebox_deviceinfo_memory_usage_bytes",
"Livebox system used memory.",
nil, nil,
),
@ -79,8 +79,8 @@ func (d *DeviceInfo) memoryStatus(c chan<- prometheus.Metric) {
return
}
c <- prometheus.MustNewConstMetric(d.memoryTotalMetric, prometheus.GaugeValue, memoryStatus.Status.Total)
c <- prometheus.MustNewConstMetric(d.memoryUsageMetric, prometheus.GaugeValue, memoryStatus.Status.Total-memoryStatus.Status.Free)
c <- prometheus.MustNewConstMetric(d.memoryTotalMetric, prometheus.GaugeValue, 1000*memoryStatus.Status.Total)
c <- prometheus.MustNewConstMetric(d.memoryUsageMetric, prometheus.GaugeValue, 1000*(memoryStatus.Status.Total-memoryStatus.Status.Free))
}
// Collect collects all DeviceInfo metrics.