mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-01-01 08:57:31 -08:00
Changing datastructure for BuddyInfo
This commit is contained in:
parent
5ab285e098
commit
19813d3e02
|
@ -61,15 +61,13 @@ func (c *buddyinfoCollector) Update(ch chan<- prometheus.Metric) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("Set node_buddy: %#v", buddyInfo)
|
log.Debugf("Set node_buddy: %#v", buddyInfo)
|
||||||
for node, zones := range buddyInfo {
|
for _, entry := range buddyInfo {
|
||||||
for zone, values := range zones {
|
for size, value := range entry.Sizes {
|
||||||
for size, value := range values {
|
ch <- prometheus.MustNewConstMetric(
|
||||||
ch <- prometheus.MustNewConstMetric(
|
c.desc,
|
||||||
c.desc,
|
prometheus.GaugeValue, value,
|
||||||
prometheus.GaugeValue, value,
|
entry.Node, entry.Zone, strconv.Itoa(size),
|
||||||
node, zone, strconv.Itoa(size),
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue