redistimeseries-go icon indicating copy to clipboard operation
redistimeseries-go copied to clipboard

Unexpected type for time in milliseconds

Open nerg4l opened this issue 3 years ago • 0 comments

I started to use this library to create an uptime service. While using this lib I noticed it is quite annoying to pass time and duration values in some cases because the accepted value most of the cases is an int or uint instead of time.Time or time.Duration.

  • RetentionMSecs field of CreateOptions is time.Duration.
  • TimeBucket field of RangeOptions and MultiRangeOptions is int.
  • fromTimestamp and toTimestamp parameter of RangeWithOptions is int64.
  • bucketSizeMSec parameter of CreateRule is uint.

Furthermore, TimeRangeMinimum and TimeRangeMaximum are ints there for the following code fails to compile:

start := rts.TimeRangeMinimum
end := rts.TimeRangeMaximum
points, err := c.RangeWithOptions("key", start, end, rts.DefaultRangeOptions)

Is it something which could be fixed in a potential v2 in the future?

nerg4l avatar Dec 23 '21 20:12 nerg4l