Class GcInvertedParallelismRule

java.lang.Object
org.openjdk.jmc.flightrecorder.rules.jdk.memory.GcInvertedParallelismRule
All Implemented Interfaces:
IRule

public class GcInvertedParallelismRule extends Object implements IRule
Rule that checks for "Inverted Parallelism", as described by the Garbagecat GC log analysis tool. Checks if the parallel collection performance is less than serial (single-threaded). See: https://github.com/mgm3746/garbagecat/blob/main/src/main/java/org/eclipselabs/garbagecat/util/jdk/JdkMath.java#L365
  • Field Details

    • GC_CPU_TIME_EVENT_COUNT

      public static final TypedResult<org.openjdk.jmc.common.unit.IQuantity> GC_CPU_TIME_EVENT_COUNT
    • INVERTED_PARALLELISM_COUNT

      public static final TypedResult<Long> INVERTED_PARALLELISM_COUNT
  • Constructor Details

    • GcInvertedParallelismRule

      public GcInvertedParallelismRule()
  • Method Details

    • createEvaluation

      public RunnableFuture<IResult> createEvaluation(org.openjdk.jmc.common.item.IItemCollection items, org.openjdk.jmc.common.util.IPreferenceValueProvider valueProvider, IResultValueProvider resultProvider)
      Specified by:
      createEvaluation in interface IRule
    • calcParallelism

      public static int calcParallelism(long timeUser, long timeSys, long timeReal)
      Calculate parallelism, the ratio of user + sys to wall (real) time.
      Parameters:
      timeUser - The user (non-kernel) time.
      timeSys - The sys (kernel) time.
      timeReal - The wall (clock) time.
      Returns:
      Percent user:real time rounded up the the nearest whole number.
    • isInvertedParallelism

      public static boolean isInvertedParallelism(int parallelism)
      Parameters:
      parallelism - The parallelism percent (ratio or user to wall (real time).
      Returns:
      True if the parallelism is "inverted", false otherwise. Inverted parallelism is less than 100. In other words, the parallel collection performance is less than serial (single-threaded).
    • getConfigurationAttributes

      public Collection<org.openjdk.jmc.common.util.TypedPreference<?>> getConfigurationAttributes()
      Specified by:
      getConfigurationAttributes in interface IRule
    • getId

      public String getId()
      Specified by:
      getId in interface IRule
    • getName

      public String getName()
      Specified by:
      getName in interface IRule
    • getTopic

      public String getTopic()
      Specified by:
      getTopic in interface IRule
    • getRequiredEvents

      public Map<String,RulesToolkit.EventAvailability> getRequiredEvents()
      Specified by:
      getRequiredEvents in interface IRule
    • getResults

      public Collection<TypedResult<?>> getResults()
      Specified by:
      getResults in interface IRule