public class VirtualMachineMetrics extends Object
Modifier and Type | Class and Description |
---|---|
static class |
VirtualMachineMetrics.BufferPoolStats
|
static class |
VirtualMachineMetrics.GarbageCollectorStats
Per-GC statistics.
|
Modifier and Type | Method and Description |
---|---|
int |
daemonThreadCount()
Returns the number of live daemon threads.
|
Set<String> |
deadlockedThreads()
Returns a set of strings describing deadlocked threads, if any are deadlocked.
|
double |
fileDescriptorUsage()
Returns the percentage of available file descriptors which are currently in use.
|
Map<String,VirtualMachineMetrics.GarbageCollectorStats> |
garbageCollectors()
Returns a map of garbage collector names to garbage collector information.
|
Map<String,VirtualMachineMetrics.BufferPoolStats> |
getBufferPoolStats() |
static VirtualMachineMetrics |
getInstance()
The default instance of
VirtualMachineMetrics . |
double |
heapCommitted()
Returns the heap memory committed to the JVM.
|
double |
heapInit()
Returns the heap initial memory of the current JVM.
|
double |
heapMax()
Returns the heap memory currently used by the current JVM.
|
double |
heapUsage()
Returns the percentage of the JVM's heap which is being used.
|
double |
heapUsed()
Returns the heap memory currently used by the current JVM.
|
Map<String,Double> |
memoryPoolUsage()
Returns a map of memory pool names to the percentage of that pool which is being used.
|
String |
name()
Returns the name of the currently-running jvm.
|
double |
nonHeapUsage()
Returns the percentage of the JVM's non-heap memory (e.g., direct buffers) which is being
used.
|
int |
threadCount()
Returns the number of live threads (includes
daemonThreadCount() . |
void |
threadDump(OutputStream out)
Dumps all of the threads' current information to an output stream.
|
Map<Thread.State,Double> |
threadStatePercentages()
Returns a map of thread states to the percentage of all threads which are in that state.
|
double |
totalCommitted()
Returns the total memory committed to the JVM.
|
double |
totalInit()
Returns the total initial memory of the current JVM.
|
double |
totalMax()
Returns the total memory currently used by the current JVM.
|
double |
totalUsed()
Returns the total memory currently used by the current JVM.
|
long |
uptime()
Returns the number of seconds the JVM process has been running.
|
String |
version()
Returns the version of the currently-running jvm.
|
public static VirtualMachineMetrics getInstance()
VirtualMachineMetrics
.instance
public double totalInit()
public double totalUsed()
public double totalMax()
public double totalCommitted()
public double heapInit()
public double heapUsed()
public double heapMax()
public double heapCommitted()
public double heapUsage()
public double nonHeapUsage()
public Map<String,Double> memoryPoolUsage()
public double fileDescriptorUsage()
NaN
if the running JVM does not have access to this informationpublic String version()
public String name()
public long uptime()
public int threadCount()
daemonThreadCount()
.public int daemonThreadCount()
public Map<String,VirtualMachineMetrics.GarbageCollectorStats> garbageCollectors()
public Set<String> deadlockedThreads()
public Map<Thread.State,Double> threadStatePercentages()
public void threadDump(OutputStream out)
out
- an output streampublic Map<String,VirtualMachineMetrics.BufferPoolStats> getBufferPoolStats()
Copyright © 2014. All Rights Reserved.