mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 15:09:45 -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)
|
||||
for node, zones := range buddyInfo {
|
||||
for zone, values := range zones {
|
||||
for size, value := range values {
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.desc,
|
||||
prometheus.GaugeValue, value,
|
||||
node, zone, strconv.Itoa(size),
|
||||
)
|
||||
}
|
||||
for _, entry := range buddyInfo {
|
||||
for size, value := range entry.Sizes {
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.desc,
|
||||
prometheus.GaugeValue, value,
|
||||
entry.Node, entry.Zone, strconv.Itoa(size),
|
||||
)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue