JMC-5703: HighGcRule should report extra needed event types

Ken Dobson kdobson at redhat.com
Tue Nov 6 16:55:01 UTC 2018


Here's the updated patch, there doesn't appear to be any translations for
it.

Ken

diff -r b3a23786ef23
core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
---
a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
Wed Oct 10 16:43:35 2018 -0400
+++
b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
Tue Nov 06 11:49:43 2018 -0500
@@ -86,7 +86,8 @@
             String longMessage = message + " " +
Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG); //$NON-NLS-1$
             if (!RulesToolkit.isEventsEnabled(items,
JdkTypeIDs.ALLOC_INSIDE_TLAB, JdkTypeIDs.ALLOC_OUTSIDE_TLAB)) {
                 longMessage = longMessage + "<p>" //$NON-NLS-1$
-                        +
Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED);
+                        +
RulesToolkit.getEnabledEventTypesRecommendation(items,
+                                JdkTypeIDs.ALLOC_INSIDE_TLAB,
JdkTypeIDs.ALLOC_OUTSIDE_TLAB);
             }
             return new Result(this, score, message, longMessage,
JdkQueries.GC_PAUSE);
         }
diff -r b3a23786ef23
core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java
---
a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java
Wed Oct 10 16:43:35 2018 -0400
+++
b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/Messages.java
Tue Nov 06 11:49:43 2018 -0500
@@ -298,7 +298,6 @@
     public static final String HighGcRuleFactory_RULE_NAME =
"HighGcRuleFactory_RULE_NAME"; //$NON-NLS-1$
     public static final String HighGcRuleFactory_TEXT_INFO =
"HighGcRuleFactory_TEXT_INFO"; //$NON-NLS-1$
     public static final String HighGcRuleFactory_TEXT_INFO_LONG =
"HighGcRuleFactory_TEXT_INFO_LONG"; //$NON-NLS-1$
-    public static final String
HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED =
"HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED"; //$NON-NLS-1$
     public static final String HighGcRuleFactory_TEXT_OK =
"HighGcRuleFactory_TEXT_OK"; //$NON-NLS-1$
     public static final String HighJvmCpuRule_AGGR_MAX_ENDTIME =
"HighJvmCpuRule_AGGR_MAX_ENDTIME"; //$NON-NLS-1$
     public static final String HighJvmCpuRule_AGGR_MIN_ENDTIME =
"HighJvmCpuRule_AGGR_MIN_ENDTIME"; //$NON-NLS-1$
diff -r b3a23786ef23
core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties
---
a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties
Wed Oct 10 16:43:35 2018 -0400
+++
b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/resources/org/openjdk/jmc/flightrecorder/rules/jdk/messages/internal/messages.properties
Tue Nov 06 11:49:43 2018 -0500
@@ -321,7 +321,6 @@
 # {0} is a time period, {1} is a time stamp, {2} is a percentage
 HighGcRuleFactory_TEXT_INFO=The JVM was paused for {2} of the time during
{0} starting at {1}.
 HighGcRuleFactory_TEXT_INFO_LONG=The time spent performing garbage
collection may be reduced by increasing the heap size or by trying to
reduce allocation.
-HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED=Some allocation events
were disabled in this recording. Enable them to help with troubleshooting
this problem.
 HighGcRuleFactory_TEXT_OK=The runtime did not spend much time performing
garbage collections.
 HighJvmCpuRule_AGGR_MAX_ENDTIME=Max End Time
 HighJvmCpuRule_AGGR_MIN_ENDTIME=Min End Time

On Tue, Nov 6, 2018 at 11:43 AM Marcus Hirt <marcus.hirt at oracle.com> wrote:

> Hi Ken,
>
> Yes, if it is no longer used, please go ahead and remove both the constant
> and
> the entry in the associated properties files (might as well remove it from
> the
> translated files too).
>
> Kind regards,
> Marcus
>
> On 2018-11-06, 17:08, "jmc-dev on behalf of Ken Dobson" <
> jmc-dev-bounces at openjdk.java.net on behalf of kdobson at redhat.com> wrote:
>
>     Hi all,
>
>     This is a small patch to make the highGcRule consistent with the
>     GcFreedRatioRule when reporting extra needed event types.
>     Should I remove HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED from
>     Messages.java given it is no longer used?
>
>     Thanks,
>
>     Ken Dobson
>
>     diff -r b3a23786ef23
>
> core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
>     ---
>
> a/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
>     Wed Oct 10 16:43:35 2018 -0400
>     +++
>
> b/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/memory/HighGcRule.java
>     Tue Nov 06 10:33:20 2018 -0500
>     @@ -84,9 +84,11 @@
>                  String message =
>
> MessageFormat.format(Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO),
>     duration,
>                          startTime,
>     pausePercent.displayUsing(IDisplayable.AUTO));
>                  String longMessage = message + " " +
>     Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG);
>     //$NON-NLS-1$
>                  if (!RulesToolkit.isEventsEnabled(items,
>     JdkTypeIDs.ALLOC_INSIDE_TLAB, JdkTypeIDs.ALLOC_OUTSIDE_TLAB)) {
>                      longMessage = longMessage + "<p>" //$NON-NLS-1$
>     -                        +
>
> Messages.getString(Messages.HighGcRuleFactory_TEXT_INFO_LONG_ALLOC_DISABLED);
>     +                        +
>     RulesToolkit.getEnabledEventTypesRecommendation(items,
>     +                                JdkTypeIDs.ALLOC_INSIDE_TLAB,
>     JdkTypeIDs.ALLOC_OUTSIDE_TLAB);
>                  }
>                  return new Result(this, score, message, longMessage,
>     JdkQueries.GC_PAUSE);
>              }
>
>
>
>
>


More information about the jmc-dev mailing list