Class JPPFStatisticsHelper

java.lang.Object
org.jppf.utils.stats.JPPFStatisticsHelper

public final class JPPFStatisticsHelper extends Object
This helper class holds the constants definitions for the labels of the statistics snapshots used in JPPF, along with utility methods.
Author:
Laurent Cohen
  • Field Details

  • Constructor Details

    • JPPFStatisticsHelper

      public JPPFStatisticsHelper()
  • Method Details

    • isSingleValue

      public static boolean isSingleValue(JPPFSnapshot snapshot)
      Determine wether the specified snapshot is a single value snapshot.
      Parameters:
      snapshot - the snapshot to evaluate.
      Returns:
      true if the snapshot is a single value snapshot, false otherwise.
    • isCumulative

      public static boolean isCumulative(JPPFSnapshot snapshot)
      Determine wether the specified snapshot is a cumulative snapshot.
      Parameters:
      snapshot - the snapshot to evaluate.
      Returns:
      true if the snapshot is a cumulative snapshot, false otherwise.
    • isNonCumulative

      public static boolean isNonCumulative(JPPFSnapshot snapshot)
      Determine wether the specified snapshot is a non-cumulative snapshot.
      Parameters:
      snapshot - the snapshot to evaluate.
      Returns:
      true if the snapshot is a non-cumulative snapshot, false otherwise.
    • getLocalizedLabel

      public static String getLocalizedLabel(JPPFSnapshot snapshot)
      Get the localized translation of the label of the specified snapshot in the current locale.
      Parameters:
      snapshot - the snapshot whose label to translate.
      Returns:
      a translation of the label, or the label itself if no translation could be found.
    • getLocalizedLabel

      public static String getLocalizedLabel(JPPFSnapshot snapshot, Locale locale)
      Get the localized translation of the label of the specified snapshot in the specified locale.
      Parameters:
      snapshot - the snapshot whose label to translate.
      locale - the locale in which to translate.
      Returns:
      a translation of the label, or the label itself if no translation could be found.
    • toProperties

      public static void toProperties(TypedProperties statsProperties, JPPFSnapshot snapshot)
      Add or update the values of the specified snapshot as properties in the specified set of properties.
      Parameters:
      statsProperties - the set of properties to update.
      snapshot - the snapshot to update from.
    • createServerStatistics

      public static JPPFStatistics createServerStatistics()
      Create a statistics object initialized with all the required server snapshots.
      Returns:
      a JPPFStatistics instance.