public class Diagnostics
extends java.lang.Object
Provides access to various metrics helpful for system diagnosis.
Modifier and Type | Field and Description |
---|---|
static java.lang.management.MemoryMXBean |
MEM_BEAN |
static java.lang.management.OperatingSystemMXBean |
OS_BEAN |
static java.lang.management.RuntimeMXBean |
RUNTIME_BEAN |
static java.lang.management.ThreadMXBean |
THREAD_BEAN |
Constructor and Description |
---|
Diagnostics() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
collect()
Collects all available infos in one map.
|
static java.lang.String |
collectAndFormat()
Collects all available infos and formats it in a better readable way.
|
static void |
gcInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the
GarbageCollectorMXBean . |
static void |
memInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the
MemoryMXBean . |
static void |
runtimeInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the
RuntimeMXBean . |
static void |
systemInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the
OperatingSystemMXBean . |
static void |
threadInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the
ThreadMXBean . |
public static final java.lang.management.OperatingSystemMXBean OS_BEAN
public static final java.lang.management.MemoryMXBean MEM_BEAN
public static final java.lang.management.RuntimeMXBean RUNTIME_BEAN
public static final java.lang.management.ThreadMXBean THREAD_BEAN
public static void systemInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the OperatingSystemMXBean
.
infos
- a map where the infos are passed in.public static void gcInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the GarbageCollectorMXBean
.
infos
- a map where the infos are passed in.public static void memInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the MemoryMXBean
.
infos
- a map where the infos are passed in.public static void runtimeInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the RuntimeMXBean
.
infos
- a map where the infos are passed in.public static void threadInfo(java.util.Map<java.lang.String,java.lang.Object> infos)
Collects system information as delivered from the ThreadMXBean
.
infos
- a map where the infos are passed in.public static java.util.Map<java.lang.String,java.lang.Object> collect()
Collects all available infos in one map.
public static java.lang.String collectAndFormat()
Collects all available infos and formats it in a better readable way.