diff --git a/statsdaemon.go b/statsdaemon.go index a0c40e6..fb6b046 100644 --- a/statsdaemon.go +++ b/statsdaemon.go @@ -209,7 +209,7 @@ func processTimers(buffer *bytes.Buffer, numStats *int, now int64) { var z Uint64Slice timers[u] = z - fmt.Fprintf(buffer, "%s.mean %d %d\n", u, mean, now) + fmt.Fprintf(buffer, "%s.mean %f %d\n", u, mean, now) fmt.Fprintf(buffer, "%s.upper %d %d\n", u, max, now) fmt.Fprintf(buffer, "%s.lower %d %d\n", u, min, now) fmt.Fprintf(buffer, "%s.count %d %d\n", u, count, now) diff --git a/statsdaemon_test.go b/statsdaemon_test.go index be65baf..272c6ef 100644 --- a/statsdaemon_test.go +++ b/statsdaemon_test.go @@ -102,7 +102,7 @@ func TestMean(t *testing.T) { processTimers(buff, &numStats, time.Now().Unix()) assert.Equal(t, numStats, 1) dataForGraphite := buff.String() - meanRegexp := regexp.MustCompile("response_time.mean.*float64=20") + meanRegexp := regexp.MustCompile("response_time.mean.*20") matched := meanRegexp.MatchString(dataForGraphite) assert.Equal(t, matched, true)