Fill HELP and TYPE for metrics.

Fixes #2.
This commit is contained in:
2020-12-23 15:40:48 +05:00
parent c34babeaf8
commit 2e8fdb194c
2 changed files with 83 additions and 16 deletions

View File

@@ -74,7 +74,10 @@ func (s *Storage) Put(data map[string]models.Metric) {
defer s.dataMutex.Unlock()
for k, v := range data {
s.data[k] = v
// We should not put valueless metrics.
if v.Value != "" {
s.data[k] = v
}
}
log.Println("Put", len(data), "items in", s.name)