Skip to content

Commit

Permalink
Merge pull request #21 from ebaron/start-end-overflow
Browse files Browse the repository at this point in the history
Avoid converting start/end times to int type
  • Loading branch information
burmanm committed Dec 14, 2017
2 parents 4863013 + a674bb9 commit fb10361
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions metrics/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,12 @@ func IdFilter(regexp string) Filter {

// StartTimeFilter is a query parameter to filter with start time
func StartTimeFilter(startTime time.Time) Filter {
// return Param("start", strconv.Itoa(int(startTime.Unix())))
return Param("start", strconv.Itoa(int(ToUnixMilli(startTime))))
return Param("start", strconv.FormatInt(ToUnixMilli(startTime), 10))
}

// EndTimeFilter is a query parameter to filter with end time
func EndTimeFilter(endTime time.Time) Filter {
return Param("end", strconv.Itoa(int(ToUnixMilli(endTime))))
return Param("end", strconv.FormatInt(ToUnixMilli(endTime), 10))
}

// BucketsFilter is a query parameter to define amount of buckets
Expand Down

0 comments on commit fb10361

Please sign in to comment.