RFR: 7506: Incorrect numeric formatting of PID by JMC [v2]

Suchita Chaturvedi schaturvedi at openjdk.org
Fri Mar 29 03:14:35 UTC 2024


On Mon, 25 Mar 2024 15:22:22 GMT, Marcus Hirt <hirt at openjdk.org> wrote:

>> Suchita Chaturvedi has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixed the pid formatting issue on Event Browser and Properties section also
>
> core/org.openjdk.jmc.common/src/main/java/org/openjdk/jmc/common/item/Aggregators.java line 1057:
> 
>> 1055: 			@Override
>> 1056: 			public IType<? super Number> getValueType() {
>> 1057: 				return UnitLookup.RAW_NUMBER;
> 
> If we're going this route, I guess this should be RAW_LONG. It does make process identifiers prone to any changes to default formatting of longs though. Another solution would be to introduce a ProcessIdentifier content type, and handle the formatting of that content type more explicitly. This is a smaller change though, and I think acceptable for now.

I have changed the RAW_NUMBER to RAW_LONG in aggregator. 

But JDKAttribute will still be RAW_NUMBER because pid content type is in raw number format only.

<img width="380" alt="ContentTypePID" src="https://github.com/openjdk/jmc/assets/11155712/95568df7-08f5-4ea6-823a-89cd85d0f9d7">



 If I change it there then accessors are not compatible and the attribute value is not read. It shows N/A on JVM Internal screen.
<img width="419" alt="image" src="https://github.com/openjdk/jmc/assets/11155712/138c684f-c3cf-4908-9292-57d8fab1a279">


 However it shows proper value in Event Browser and Properties tab.
<img width="960" alt="image" src="https://github.com/openjdk/jmc/assets/11155712/0661f352-7155-45e9-8412-1db031fff0ee">

-------------

PR Review Comment: https://git.openjdk.org/jmc/pull/557#discussion_r1544001602


More information about the jmc-dev mailing list