-
Notifications
You must be signed in to change notification settings - Fork 160
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
Timekeeping in standard units #1178
Comments
👋 Thanks for opening this issue! Get help or engage by:
|
I agree. I'll update the API to use Instant of Duration if possible. There is one This is because the RaftMetrics must be What do you think about adding the current wall clock time into the |
Hm... Isn't it possible to store it as an I'm no |
Currently,
openraft
uses various time units. For example, a lot of timeouts and time intervals is stored in milliseconds. However, this makes it sometime cumbersome and/or confusing to handle time. Aside from that, it requires additional multiplications/divisions.My suggestion is to change all time fields to standard types
Instant
andDuration
and where needed (e.g., on API level) provide old methods which recompute internally.Similarly, storing "time since" is problematic (I've seen it somewhere, not sure where), since it doesn't say when it was computed. In such cases, storing an
Instant
of the event would be better. Then, atnow()
, it's easily possible to compute the duration by a simple subtraction.The text was updated successfully, but these errors were encountered: