fix block nesting bug causing filefd values to never be updated post initial call

This commit is contained in:
Erkki Eilonen 2016-01-13 21:09:01 +07:00
parent a59c71b505
commit ff7106615e

View file

@ -59,13 +59,13 @@ func (c *fileFDStatCollector) Update(ch chan<- prometheus.Metric) (err error) {
Help: fmt.Sprintf("File descriptor statistics: %s.", name), Help: fmt.Sprintf("File descriptor statistics: %s.", name),
}, },
) )
}
v, err := strconv.ParseFloat(value, 64) v, err := strconv.ParseFloat(value, 64)
if err != nil { if err != nil {
return fmt.Errorf("invalid value %s in file-nr: %s", value, err) return fmt.Errorf("invalid value %s in file-nr: %s", value, err)
} }
c.metrics[name].Set(v) c.metrics[name].Set(v)
} }
}
for _, m := range c.metrics { for _, m := range c.metrics {
m.Collect(ch) m.Collect(ch)
} }