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