RFR: 8244: Turn off scientific notation in JMC for attributes with long data type
Brice Dutheil
bdutheil at openjdk.org
Fri Aug 9 12:50:37 UTC 2024
On Sun, 28 Jul 2024 19:24:56 GMT, Suchita Chaturvedi <schaturvedi at openjdk.org> wrote:
> This PR resolves the issue of scientific notation display for attributes with long datatype. This was the common pain-point of several customers and we were getting repeated requests of fixing this issue as they were not able to analyze the data due to this format of display. Since there is very less difference between the values of each row, after converting it to scientific notation all values look-alike and its difficult for customers to analyze the data. We have consulted the JFR team and there was a suggestion of skipping long attributes for this format display as they have followed in JFR-tools also. Same approach I have followed in JMC too. Please provide your valuable feedbacks.
>
> Attaching few screenshots for better reference:
>
> Before:
> <img width="464" alt="image" src="https://github.com/user-attachments/assets/44566b32-8f40-4f14-8885-c81ebd2e1d97">
>
> After:
> <img width="473" alt="image" src="https://github.com/user-attachments/assets/788785b1-d3b1-42fc-ae52-c03d01b20da2">
>
> Before:
> <img width="394" alt="image" src="https://github.com/user-attachments/assets/32568ba2-9925-4914-91db-d949f4f6d78e">
>
> After:
> <img width="385" alt="image" src="https://github.com/user-attachments/assets/90288ce2-1565-41ba-87c3-0e1fcc28b1ad">
>
> Before:
> <img width="688" alt="image" src="https://github.com/user-attachments/assets/0968b452-8097-4e71-b951-55c9996de8f6">
>
> After:
> <img width="692" alt="image" src="https://github.com/user-attachments/assets/0388ae51-dfc4-46b4-9e64-857b81da1853">
This PR looks good to me for the immediate problem, but I wonder if other predefined "attributes" could benefit from that approach.
core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/jdk/JdkAttributes.java line 813:
> 811: return countNumber == null ? null : UnitLookup.NUMBER_UNITY.quantity(countNumber);
> 812: }
> 813: };
**question:** For readability I wonder of these attributes might be converted to lambda, e.g. :
Suggestion:
return accessor == null ? null : i -> {
Number countNumber = accessor.getMember(i);
return countNumber == null ? null : UnitLookup.NUMBER_UNITY.quantity(countNumber);
};
core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/jdk/JdkAttributes.java line 817:
> 815: });
> 816:
> 817: public static final IAttribute<IQuantity> CLASSLOADER_UNLOADED_COUNT = attr("unloadedClassCount", //$NON-NLS-1$
**question:** Could this be useful to have that for similar attributes like `unloadedClassCount`.
-------------
Marked as reviewed by bdutheil (Committer).
PR Review: https://git.openjdk.org/jmc/pull/572#pullrequestreview-2230080132
PR Review Comment: https://git.openjdk.org/jmc/pull/572#discussion_r1711398125
PR Review Comment: https://git.openjdk.org/jmc/pull/572#discussion_r1711383737
More information about the jmc-dev
mailing list