Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Ensures that metric type config is not nil before we call collect
Browse files Browse the repository at this point in the history
  • Loading branch information
jcooklin committed Oct 23, 2015
1 parent 091f3c6 commit efd20da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scheduler/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ func (c *collectorJob) Run() {
}).Debug("starting collector job")
metrics := make([]core.Metric, len(c.metricTypes))
for i, rmt := range c.metricTypes {
config := c.configDataTree.Get(rmt.Namespace())
if config == nil {
config = cdata.NewNode()
}
metrics[i] = &metric{
namespace: rmt.Namespace(),
version: rmt.Version(),
config: c.configDataTree.Get(rmt.Namespace()),
config: config,
}
}
ret, errs := c.collector.CollectMetrics(metrics, c.Deadline())
Expand Down

0 comments on commit efd20da

Please sign in to comment.