-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[Core] Add TimeStampMillis to TimeStampedEvent #1594
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
[Core] Add TimeStampMillis to TimeStampedEvent #1594
Conversation
443382e to
b75b940
Compare
core/src/test/java/cucumber/runtime/formatter/JSONFormatterTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/cucumber/runtime/formatter/JSONFormatter.java
Outdated
Show resolved
Hide resolved
|
Loos pretty good :) I like that we are using the timeStampMillis in all the other places as well now, it would probably be super useful. How do u feel about just sending the end and start times in the report and leaving the calculation of the duration to the system using the report instead? (since we have added start time anyway) |
Useful for what exactly? There are two broad categories:
Nano time is often best for duration, Millis time is often best for time. See https://stackoverflow.com/questions/351565/system-currenttimemillis-vs-system-nanotime What are we trying to accomplish with these timestamps? |
|
I agree we don’t need the nano precision and happy to switch to milliseconds to measure elapsed time. I’m not sure we need to store those times as duration (relative to some start time) or absolute (time since epoch). I’d like to understand what the timestamps are used for first. |
|
@aslakhellesoy The initial reason was to allow reports to know the concurrent start time of when a test case (or scenario) started, to allow them to accurately display the actual time it took to run a suite when running TCs in parallel (if we just give the duration, they do not know which TCs were run in parallel). Hence the initial PR #1591 |
|
|
@gazler22
Would be nice but we have some existing systems to support. It's also kinda convenient. |
|
I'm going to revert the use of milliseconds for duration. While test cases last milliseconds, it seems that individual steps are more granular then that. |
4bbc8fe to
705224d
Compare
A timestamp is more useful when that timestamp is relative to the epoch. Unlike `System.currentTimeMillis`, `System.nanoTime` is relative to some arbitrary point in time. Additionally the extra granularity has no practical benefit. This is evidenced by the stats, junit and, testng formatter which all express the elapsed time in milliseconds.
705224d to
0b7ff41
Compare
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
A timestamp is more useful when that timestamp is relative to the epoch.
Unlike
System.currentTimeMillis,System.nanoTimeis relative to somearbitrary point in time.
Types of changes
Checklist: