Class JvmMetrics
java.lang.Object
org.apache.hadoop.metrics2.source.JvmMetrics
- All Implemented Interfaces:
MetricsSource
JVM and logging related metrics.
Mostly used by various servers as a part of the metrics they export.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic JvmMetricscreate(String processName, String sessionId, MetricsSystem ms) voidgetMetrics(MetricsCollector collector, boolean all) Get metrics from the metrics sourcestatic JvmMetricsinitSingleton(String processName, String sessionId) static voidreattach(MetricsSystem ms, JvmMetrics jvmMetrics) voidvoidsetGcTimeMonitor(GcTimeMonitor gcTimeMonitor) voidsetPauseMonitor(JvmPauseMonitor pauseMonitor) static voidShutdown the JvmMetrics singleton.
-
Field Details
-
MEMORY_MAX_UNLIMITED_MB
public static final float MEMORY_MAX_UNLIMITED_MB- See Also:
-
-
Method Details
-
registerIfNeeded
@VisibleForTesting public void registerIfNeeded() -
setPauseMonitor
-
setGcTimeMonitor
-
create
-
reattach
-
initSingleton
-
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
Description copied from interface:MetricsSourceGet metrics from the metrics source- Specified by:
getMetricsin interfaceMetricsSource- Parameters:
collector- to contain the resulting metrics snapshotall- if true, return all metrics even if unchanged.
-