RFR: 8055: Improvement in stacktrace view for Duration [v5]
Alex Macdonald
aptmac at openjdk.org
Tue May 30 04:05:02 UTC 2023
On Mon, 29 May 2023 17:18:34 GMT, Suchita Chaturvedi <schaturvedi at openjdk.org> wrote:
>> 1. Added a new column for Duration. It will be populated only when the "Show Duration" toggle icon is clicked. Not by default.
>> 2. Fixed NaN issue for screens where duration is not present.
>> 3. Added timeunit to make tooltip more meaningful.
>>
>> Please refer JIRA description for more details.
>
> Suchita Chaturvedi has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixed spotless issue
I'm still getting a bit re-acclimated with the codebase here, sorry for going back and forth. But if the duration is already in the form of an IQuantity before passing it to `formatDuration()`, couldn't the duration be formatted without the if-statements checks? Off the top of my head, something like `duration.LongValueIn(UnitLookup.SECOND)` and then putting that into `Duration.ofSeconds()` knowing that the duration is already formatted in seconds? Otherwise it looks like microseconds is also one of the 5 fields in timespan, it would probably need a check too just incase that ever occurred.
Just to make sure I'm thinking about this right after reading the JMC-8055 issue in JIRA, the idea for the duration column to tell how much time was spent in each stacktrace frame, which adds more context to the percent by duration column. I've tried a couple recordings on the threads page at the moment, and the duration is showing values that far exceed the length of the recording (19 hours & 8 hours, for a 2 minute recording). I'm thinking maybe there's something wrong with the calculation?

-------------
PR Comment: https://git.openjdk.org/jmc/pull/475#issuecomment-1567726525
More information about the jmc-dev
mailing list