Changing datastructure for BuddyInfo

This commit is contained in:
Thorhallur Sverrisson 2017-02-07 10:48:07 -06:00
parent 5ab285e098
commit 19813d3e02

View file

@ -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