Skip to content

Commit

Permalink
fix ms type too
Browse files Browse the repository at this point in the history
  • Loading branch information
itso committed Jul 26, 2018
1 parent 06b6b85 commit d16b578
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions statsdaemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,14 @@ func parseLine(line []byte) *Packet {
case "ms":
value, err = strconv.ParseUint(string(val), 10, 64)
if err != nil {
log.Printf("ERROR: failed to ParseUint %s - %s", string(val), err)
return nil
//try to round a float
value, err = strconv.ParseFloat(string(val), 64)
if (err != nil) {
log.Printf("ERROR: failed to Parse (type ms): %s - %s", string(val), err)
return nil
} else {
value = rounduint64(value.(float64))
}
}
stattype = "timers."
default:
Expand Down

0 comments on commit d16b578

Please sign in to comment.