RFR: 8055: Improvement in stacktrace view for Duration [v2]
Alex Macdonald
aptmac at openjdk.org
Tue May 23 17:17:06 UTC 2023
On Sun, 21 May 2023 10:35:32 GMT, Suchita Chaturvedi <schaturvedi at openjdk.org> wrote:
>> Also are these the only possible time formats? I was playing around with some of recordings and on the threads pages the string unit sometimes comes in as ticks, so the duration just lists "NA" in the column (but the percentage by duration column still works).
>
> Implemented the first review comment.
> I have implemented as per the ones available in java.time.Duration class and the general units which I could see with the recordings I have. I couldn't find ticks in Duration class. May be we can modify the code in future as and when required with a simple P4 JIRA Ticket.
Is that the correct duration? I was thinking that it might not be related to the duration of java.time.Duration, but instead to the duration relating to jdk.jfr (timespan?).
The `formatDuration()` here gets the duration from `StacktraceView.getDurationCount()` [[0]](https://github.com/openjdk/jmc/blob/master/application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/views/stacktrace/StacktraceView.java#LL943C1-L943C2), which looks up the duration in the form of a timespan [[1]](https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/JfrAttributes.java#L108).
Timespans [[2]](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.jfr/jdk/jfr/Timespan.html) have fields for microseconds, milliseconds, nanoseconds, seconds, and ticks, which explains what I'm seeing one of my recordings.
[0] https://github.com/openjdk/jmc/blob/master/application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/views/stacktrace/StacktraceView.java#LL943C1-L943C2
[1] https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/JfrAttributes.java#L108
[2] https://docs.oracle.com/en/java/javase/17/docs/api/jdk.jfr/jdk/jfr/Timespan.html
-------------
PR Review Comment: https://git.openjdk.org/jmc/pull/475#discussion_r1202734979
More information about the jmc-dev
mailing list