Skip to content

Commit

Permalink
Merge pull request #6 from rymo4/fix_floats_in_mean
Browse files Browse the repository at this point in the history
Fix How Mean Deals With Floats
  • Loading branch information
ploxiln committed Jul 17, 2013
2 parents 45b7f50 + f7f0680 commit cc5c803
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion statsdaemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion statsdaemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cc5c803

Please sign in to comment.