RFR: 8073: Rule result visibility not always toggleable in Results Page

Marcus Hirt hirt at openjdk.org
Fri May 26 01:18:02 UTC 2023


On Thu, 25 May 2023 19:55:07 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:

> This PR addresses JMC-8073 [[0]](https://bugs.openjdk.org/browse/JMC-8073), in which not all single page rule result html pages allow for the expansion and collapsing of individual rule results. These are the rule results found in the "Results" ui when viewing a jfr page (such as Garbage Collections).
> 
> The problem here is a premature slicing of the result id in the rules_overview.html when toggling the visibility [[1]](https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder.rules/src/main/resources/org/openjdk/jmc/flightrecorder/rules/report/html/internal/rules_overview.html#L285).
> 
> On the main automated analysis result page, the id can be in a format like `CompareCpu757108857_text_hide`, where we have the rule name plus a uuid, and  some html tag to identify it. In this case, `toggleVisiblity()` currently slices the first underscore, we end up with `CompareCpu757108857`, and the html is happy.
> 
> When viewing a single page result page, the uuid is instead replaced with a rule topic [[2]](https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder.rules/src/main/java/org/openjdk/jmc/flightrecorder/rules/report/html/internal/RulesHtmlToolkit.java#L177), which could be a string containing underscores itself, such as "garbage_collection" [[3]](https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder.rules/src/main/resources/org/openjdk/jmc/flightrecorder/rules/report/html/resultgroups.xml#L62). In this case, the id gets prematurely sliced into something like `GcPauseRatiogarbage_text`, which won't match a corresponding result button in the html.
> 
> The idea here is to trim the tail end of the id instead, given that there are only four possible combinations of `_score_value`, `_name`, `_heading`, and `_text_hide` that can be clicked on.
> 
> [0] https://bugs.openjdk.org/browse/JMC-8073
> [1] https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder.rules/src/main/resources/org/openjdk/jmc/flightrecorder/rules/report/html/internal/rules_overview.html#L285
> [2] https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder.rules/src/main/java/org/openjdk/jmc/flightrecorder/rules/report/html/internal/RulesHtmlToolkit.java#L178
> [3] https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder.rules/src/main/resources/org/openjdk/jmc/flightrecorder/rules/report/html/resultgroups.xml#L62

Marked as reviewed by hirt (Lead).

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

PR Review: https://git.openjdk.org/jmc/pull/487#pullrequestreview-1444838823


More information about the jmc-dev mailing list