put append back
This commit is contained in:
parent
e9f1876127
commit
007002ecfe
|
|
@ -85,18 +85,27 @@ func (u *InputUnifi) MetricsFrom(filter *poller.Filter) (*poller.Metrics, bool,
|
|||
return nil, false, nil
|
||||
}
|
||||
|
||||
// Check if the request is for an existing, configured controller.
|
||||
metrics := &poller.Metrics{}
|
||||
|
||||
// Check if the request is for an existing, configured controller (or all controllers)
|
||||
for _, c := range u.Controllers {
|
||||
if filter != nil && !strings.EqualFold(c.URL, filter.Path) {
|
||||
continue
|
||||
}
|
||||
|
||||
m, err := u.collectController(c)
|
||||
|
||||
return m, err == nil && m != nil, err
|
||||
if err != nil {
|
||||
return metrics, false, err
|
||||
}
|
||||
|
||||
if !u.Dynamic || filter == nil {
|
||||
metrics = poller.AppendMetrics(metrics, m)
|
||||
}
|
||||
|
||||
if filter == nil || len(metrics.Clients) != 0 {
|
||||
return metrics, true, nil
|
||||
}
|
||||
|
||||
if !u.Dynamic {
|
||||
return nil, false, errDynamicLookupsDisabled
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue