Skip to content
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

Support for wall-clock time in Context. #1187

Closed
rohitkulshreshtha opened this issue May 7, 2024 · 3 comments
Closed

Support for wall-clock time in Context. #1187

rohitkulshreshtha opened this issue May 7, 2024 · 3 comments
Labels
core api hydroflow excepting the surface syntax enhancement New feature or request

Comments

@rohitkulshreshtha
Copy link
Contributor

I need wall clock time for a HLC implementation.

The current implementation of Context:: current_tick_start uses std::time::instant as the type.

Should we add another field to represent wall clock time? Or should we replace current_tick_start with SystemTime?

Arguments for changing type:

  • Individual clock readings in the context are all meaningful, without the need for another timestamp. It can be used to stamp messages and events.

Arguments for keeping type (and introducing a separate field for wall clock time)

  • It helps measure the performance of operations since the start of the tick, although one can do this in other ways.

IMHO, changing the type makes more sense.

@MingweiSamuel
Copy link
Member

What do you need that Instant can't provide? Serialization/deserialization?

@rohitkulshreshtha
Copy link
Contributor Author

For Hybrid-Logical clock? I need the wall clock time. Instant is not wall clock time - it's an offset from some arbitrary event, and systems may not even agree on the "start" for measuring the offset.

For example, on Windows, instant uses QueryPerformanceCounter APIs. This is what the documentation says about the value:

QPC is independent of, and isn't synchronized to, any external time reference. To retrieve time stamps that can be synchronized to an external time reference, such as, Coordinated Universal Time (UTC) for use in high-resolution time-of-day measurements, use GetSystemTimePreciseAsFileTime.

rohitkulshreshtha added a commit that referenced this issue May 14, 2024
Addresses #1187.

Wall-clock time isn't monotonic, but that's expected to be understood.
rohitkulshreshtha added a commit that referenced this issue May 17, 2024
Addresses #1187.

Wall-clock time isn't monotonic, but that's expected to be understood.
@MingweiSamuel MingweiSamuel added enhancement New feature or request core api hydroflow excepting the surface syntax labels May 17, 2024
rohitkulshreshtha added a commit that referenced this issue May 17, 2024
Addresses #1187.

Wall-clock time isn't monotonic, but that's expected to be understood.
rohitkulshreshtha added a commit that referenced this issue May 17, 2024
Addresses #1187.

Wall-clock time isn't monotonic, but that's expected to be understood.
rohitkulshreshtha added a commit that referenced this issue May 17, 2024
Addresses #1187.

Wall-clock time isn't monotonic, but that's expected to be understood.
@rohitkulshreshtha
Copy link
Contributor Author

Fixed. #1196

For the future: #1202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core api hydroflow excepting the surface syntax enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants