public class JvmstatMonitor extends Object implements Prometheus.ExpositionHook
JvmstatMonitor provides HotSpot-specific JVM metrics through the MonitoredVm facilities.
These low-level metrics are defined in the C++ bowels of the HotSpot VM through internal measurement types. The VM exposes these through the HSPerfData interface for customers. Typically one accesses this data via a MMAPed direct buffer—namely Java native I/O (nio).
${JAVA_HOME}/lib/tools.jar to the CLASSPATH
when using this helper. This is because the sun.jvmstat.monitor package hierarchy
is not a part of the standard Java library. These packages are, however, typically included
in Sun-, Oracle-, and OpenJDK-provided virtual machines, which is to say they are ubiquitous
in most deployment environments.
-XX:+UsePerfData in the VM's flags to enable
low-level telemetric export.
The metrics that this class exposes are dependent upon the release of HotSpot, including even
minor releases. Depending on that, it may be possible to use adapt this utility to be more
flexible by incorporating support for common metric aliases, as defined in sun/jvmstat/perfdata/resources/aliasmap.
Prometheus.addPreexpositionHook(io.prometheus.client.Prometheus.ExpositionHook),
MonitoredVm| Modifier and Type | Class and Description |
|---|---|
static class |
JvmstatMonitor.AttachmentError
A
JvmstatMonitor.AttachmentError indicates that it was impossible to attach to the requested
virtual machine. |
static class |
JvmstatMonitor.ClassLoaderInstrumentation
Provide visibility about the internals of the JVM's class loader.
|
static class |
JvmstatMonitor.GarbageCollectionInstrumentation
Provide visibility about the internals of the JVM's garbage collector.
|
static class |
JvmstatMonitor.ManagedMemoryInstrumentation
Provide visibility about the internals of the JVM memory regions.
|
static class |
JvmstatMonitor.NativeCodeCompilerInstrumentation
Provide visibility about the internals of the JVM's just-in-time (JIT) compiler.
|
| Constructor and Description |
|---|
JvmstatMonitor()
Create a
JvmstatMonitor for the local virtual machine associated with this
specific Java server. |
JvmstatMonitor(sun.jvmstat.monitor.MonitoredVm b)
Create a
JvmstatMonitor monitoring bridge with a supplied MonitoredVm. |
public JvmstatMonitor() throws JvmstatMonitor.AttachmentError
Create a JvmstatMonitor for the local virtual machine associated with this
specific Java server.
{@link - AttachmentError} if the VM cannot be attached to.JvmstatMonitor.AttachmentErrorpublic JvmstatMonitor(sun.jvmstat.monitor.MonitoredVm b)
Create a JvmstatMonitor monitoring bridge with a supplied MonitoredVm.
This is only useful for reusing an existing MonitoredVm
or for testing purposes. Users are encouraged to use the JvmstatMonitor()
default constructor.
b - Copyright © 2014. All Rights Reserved.