RFR: 8351925: JFR: Microsecond time format precision for JFR tool
Erik Gahlin
egahlin at openjdk.org
Wed Apr 2 11:48:50 UTC 2025
On Mon, 31 Mar 2025 11:04:56 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> > What is the primary friction you see in --json? The verbose stack traces, too much precision, or the need to specify a command-line flag?
>
> JSON is too verbose for human consumption. I think this is mostly due to stack traces, but there are also other parts that are relatively noisy. So I cannot easily show the pair of events in a bug report / chat message to show a particular piece of JFR-captured info, without first truncating the output.
The stack trace can be removed with `--stack-depth 0`, but I agree, it's still noisy.
When `jfr` and `jfr print` were conceived, the idea was that the `--json` option could always be used when full precision was needed for verification purposes. Although it may be a bit more cumbersome to read, at least the information would not be lost.
If the use case is to copy detailed human-readable output into a bug report, perhaps there should be a switch that prints numbers and timestamps in full precision. Six digits might not be sufficient for timestamps, and then there are durations as well. I created a prototype that prints durations and timestamps with nanosecond precision, as well as the full value of bytes, bits, and percentages.
https://github.com/openjdk/jdk/pull/24372
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24029#issuecomment-2772306157
More information about the hotspot-jfr-dev
mailing list