-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8244: Turn off scientific notation in JMC for attributes with long data type #572
Conversation
👋 Welcome back schaturvedi! A progress list of the required criteria for merging this PR into |
@Suchitainf This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, although the issue title and description make reference to an option in the preferences that would control this, is this currently in the works or should the issue be updated?
Also not sure if you had seen it, but egahlin left a comment mentioning an approach that jmc 4 and jfr-tool use, which would be to only use scientific notation for floats & doubles, if that's something you'd be interested in as well.
Hi @aptmac , Thanks for taking a look at it. Actually the discussion started with giving an option (like in preference), then we had a detailed discussion with customer as well as Erik. Erik suggested to skip scientific notation for long attributes and that should solve the issue. Same concept I have followed in the fix provided as part of this PR. I agree the subject of the issue was bit confusing, I have updated the same now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good to me for the immediate problem, but I wonder if other predefined "attributes" could benefit from that approach.
}; | ||
} | ||
}); | ||
|
||
public static final IAttribute<IQuantity> CLASSLOADER_UNLOADED_COUNT = attr("unloadedClassCount", //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Could this be useful to have that for similar attributes like unloadedClassCount
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return accessor == null ? null : new IMemberAccessor<IQuantity, U>() { | ||
@Override | ||
public IQuantity getMember(U i) { | ||
Number countNumber = accessor.getMember(i); | ||
return countNumber == null ? null : UnitLookup.NUMBER_UNITY.quantity(countNumber); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: For readability I wonder of these attributes might be converted to lambda, e.g. :
return accessor == null ? null : new IMemberAccessor<IQuantity, U>() { | |
@Override | |
public IQuantity getMember(U i) { | |
Number countNumber = accessor.getMember(i); | |
return countNumber == null ? null : UnitLookup.NUMBER_UNITY.quantity(countNumber); | |
} | |
}; | |
return accessor == null ? null : i -> { | |
Number countNumber = accessor.getMember(i); | |
return countNumber == null ? null : UnitLookup.NUMBER_UNITY.quantity(countNumber); | |
}; |
@@ -792,9 +793,27 @@ public <U> IMemberAccessor<IMCThread, U> customAccessor(IType<U> type) { | |||
public static final IAttribute<String> SHUTDOWN_REASON = attr("reason", //$NON-NLS-1$ | |||
Messages.getString(Messages.ATTR_SHUTDOWN_REASON), Messages.getString(Messages.ATTR_SHUTDOWN_REASON_DESC), | |||
PLAIN_TEXT); | |||
public static final IAttribute<IQuantity> CLASSLOADER_LOADED_COUNT = attr("loadedClassCount", //$NON-NLS-1$ | |||
public static final IAttribute<Number> CLASSLOADER_LOADED_COUNT_NUMBER = attr("loadedClassCount", //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is changing the generic type for publicly defined constants, and that we would be breaking people depending on them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @thegreystone . I understand this concern, thats why I have retained the attribute with same datatype i.e. IQuantity on line number 800. So basically the internal value is number but I have written a custom accessor to retain the uniformity of IQuantity data type. So that it doesn;t break anything. Please let me know if I am missing something here.
/integrate |
Going to push as commit ab0f9a6.
Your commit was automatically rebased without conflicts. |
@Suchitainf Pushed as commit ab0f9a6. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
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:
After:
Before:
After:
Before:
After:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jmc.git pull/572/head:pull/572
$ git checkout pull/572
Update a local copy of the PR:
$ git checkout pull/572
$ git pull https://git.openjdk.org/jmc.git pull/572/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 572
View PR using the GUI difftool:
$ git pr show -t 572
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jmc/pull/572.diff
Webrev
Link to Webrev Comment