Don't include empty statistical data in results

pull/3916/head
Philip O'Toole 2015-08-31 20:50:44 -07:00
parent 9d81cdd1a4
commit 26147b2f5f
1 changed files with 7 additions and 1 deletions

View File

@ -172,7 +172,13 @@ func (s *Service) statistics() ([]*statistic, error) {
if err != nil {
continue
}
statistics[i] = newStatistic(r.name, r.tags, stats)
// If a registered client has no field data, don't include it in the results
if len(stats) == 0 {
continue
}
statistics = append(statistics, newStatistic(r.name, r.tags, stats))
}
return statistics, nil
}