Avoid int -> int64 conversions

This commit is contained in:
Holger Obermaier
2022-02-07 11:12:03 +01:00
parent 3c10c6b340
commit 25c2ae4910
4 changed files with 80 additions and 72 deletions

View File

@@ -103,9 +103,8 @@ func (m *SampleCollector) Read(interval time.Duration, output chan lp.CCMetric)
}
// Each metric has exactly one field: value !
value := map[string]interface{}{"value": int(x)}
y, err := lp.New("sample_metric", tags, m.meta, value, time.Now())
if err == nil {
value := map[string]interface{}{"value": int64(x)}
if y, err := lp.New("sample_metric", tags, m.meta, value, time.Now()); err == nil {
output <- y
}
}