-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented new TsTimeStamp type. Updated examples and tests. #35
base: master
Are you sure you want to change the base?
Conversation
Added the TsTimeBucket type with updated tests and examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shaunsales
Great PR, Thanks
Sorry for the long time it took me to return a feedback
few comments:
- the values:
public static readonly TsTimeStamp MinValue = new TsTimeStamp(_minUnixMilliseconds);
public static readonly TsTimeStamp MaxValue = new TsTimeStamp(_maxUnixMilliseconds);
Those members function with a dual purpose: value validation and replacing the -
and +
symbols, which are used in the module API.
I prefer not to have a dual purpose. As long as the module is not supporting negative values, the value validation is a welcome addition. However, instead of using the module native API, the current implementation sends actual values, which I want to avoid since module changes might change (break) the client behavior. I prefer that the properties will return the strings -
and +
2. Having functions with default timestamp value (no timestamp parameter) - great addition
3. Please use and allow implicit casting whenever possible, so the user experience moving to this version will not change dramatically.
I was thinking about this for a while when I was implementing the new timestamp and I think a good solution might be to hide the string conversion in an internal extension. I want to avoid creating any additional backing fields in the struct as currently it can be represented as a single long. The way I dealt with
Thanks.
I think we should be a little bit cautious with implicit casting, as it can cause confusion if you use out of range values. But that's more a usability thing. I'll have a look into it. Was there any specific casts you had in mind? |
|
Sure, I think that's a good compromise. I've been quite busy this week, but will try to get onto it this weekend.
Ok, no problem - I was mostly wanting to point out that it could be confusing to users if they are using implicit casts and get |
@shaunsales eventually an exception will be thrown if the user will try to use an invalid value when calling a function requiring |
@DvirDukhan Yep, let's do that. I'll let you know when the changes have been made. Thanks. |
…crBy and DecrBy examples to include timestamps. Removed duplicate examples for IncrBy and DecrBy. Tested against RedisTimeSeries 1.4.4
@shaunsales is your last commit handles the review comments? I can re-review? |
Sure. I believe all the outstanding requests have been implemented. |
@shaunsales LGTM |
@shaunsales |
Still to be implemented;