-
Notifications
You must be signed in to change notification settings - Fork 5
add "time-nanosec" field for nanosecond-resolution time #67
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
Conversation
49951db to
05afe56
Compare
|
Changed names as h2o/h2o#2053 (comment) suggested. |
toru
left a comment
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.
Good call on using the POSIX clock_gettime() instead.
|
I already use |
|
@syohex san suggested we can use C++ standard library for this purpose. https://twitter.com/syohex/status/1253527261896032256 |
|
I like this PR as-is because it's an idiomatic use of the POSIX clock_gettime(). That said, this is a very hot code path. If std::chrono gives us perf benefits, I have no objections to using it. |
I suppose there is no performance benefit. Because std::chrono API is only wrapper function of struct timespec tp;
if (0 != clock_gettime(CLOCK_REALTIME, &tp))
__throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");
return time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000)); |
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.
The current "time" field is millisecond-resolution, but it is not correctly sortable. Also, qlog can deal with usec resolution, so it is useful to provide hi-resolution time for later analysis.
I disagree about this rationale. To diagnose, what we need is the time that the transport uses. Not the actual time. Using something different than what quicly believes to be true is going to cause confusion.
PS. I also do not think that the fields would become sortable when we change the resolution to nanoseconds. If we want to sort, we need a logical clock. But I would appreciate it if you could clarify why we need to sort. Aren't the events logged in the order they are submitted?
|
Skew from not using the server time does sound real. This brings up another topic that it looks like we stopped using quicly's at/time value at some point. |
|
Please dismiss my comment from above. We do use |
|
Thanks to @kazuho, I've realized there are two problems with this PR:
Considering another way. |
The current "time" field is millisecond-resolution, but it is not correctly sortable. Also, qlog can deal with usec resolution, so it is useful to provide hi-resolution time for later analysis.
I'd like to keep the "time" field for compatibility with other tools that use quicly probes directly: https://github.com/h2o/quicly/tree/master/misc