Class JvmMetrics

java.lang.Object
org.apache.hadoop.metrics2.source.JvmMetrics
All Implemented Interfaces:
MetricsSource

@Private public class JvmMetrics extends Object implements MetricsSource
JVM and logging related metrics. Mostly used by various servers as a part of the metrics they export.
  • Field Details

    • MEMORY_MAX_UNLIMITED_MB

      public static final float MEMORY_MAX_UNLIMITED_MB
      See Also:
  • Method Details

    • registerIfNeeded

      @VisibleForTesting public void registerIfNeeded()
    • setPauseMonitor

      public void setPauseMonitor(JvmPauseMonitor pauseMonitor)
    • setGcTimeMonitor

      public void setGcTimeMonitor(GcTimeMonitor gcTimeMonitor)
    • create

      public static JvmMetrics create(String processName, String sessionId, MetricsSystem ms)
    • reattach

      public static void reattach(MetricsSystem ms, JvmMetrics jvmMetrics)
    • initSingleton

      public static JvmMetrics initSingleton(String processName, String sessionId)
    • shutdownSingleton

      public static void shutdownSingleton()
      Shutdown the JvmMetrics singleton. This is not necessary if the JVM itself is shutdown, but may be necessary for scenarios where JvmMetrics instance needs to be re-created while the JVM is still around. One such scenario is unit-testing.
    • getMetrics

      public void getMetrics(MetricsCollector collector, boolean all)
      Description copied from interface: MetricsSource
      Get metrics from the metrics source
      Specified by:
      getMetrics in interface MetricsSource
      Parameters:
      collector - to contain the resulting metrics snapshot
      all - if true, return all metrics even if unchanged.