public class Diagnostics
extends java.lang.Object
Constructor and Description |
---|
Diagnostics() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
findDeadlock()
Check if any threads are deadlocked.
|
static void |
gc()
Initiate garbage collection via MX Bean
|
static java.lang.String |
getThreadDump()
Retrieves a formatted JVM thread dump.
|
static java.lang.String |
getThreadDump(java.util.Enumeration<java.util.Locale> requestedLocales)
Retrieves a formatted JVM thread dump.
|
static java.lang.String |
getThreadDump(StringManager requestedSm)
Retrieve a JVM thread dump formatted
using the given StringManager.
|
static java.lang.String |
getVMInfo()
Retrieves a formatted JVM information text.
|
static java.lang.String |
getVMInfo(java.util.Enumeration<java.util.Locale> requestedLocales)
Retrieves a formatted JVM information text.
|
static java.lang.String |
getVMInfo(StringManager requestedSm)
Retrieve a JVM information text formatted
using the given StringManager.
|
static boolean |
isThreadContentionMonitoringEnabled()
Check whether thread contention monitoring is enabled.
|
static boolean |
isThreadCpuTimeEnabled()
Check whether thread cpu time measurement is enabled.
|
static void |
resetPeakThreadCount()
Reset peak thread count in ThreadMXBean
|
static void |
resetPeakUsage(java.lang.String name)
Reset peak memory usage data in MemoryPoolMXBean
|
static boolean |
setCollectionUsageThreshold(java.lang.String name,
long threshold)
Set collection usage threshold in MemoryPoolMXBean
|
static void |
setLoggerLevel(java.lang.String loggerName,
java.lang.String levelName)
Set logger level
|
static void |
setThreadContentionMonitoringEnabled(boolean enable)
Enable or disable thread contention monitoring via the ThreadMxMXBean.
|
static void |
setThreadCpuTimeEnabled(boolean enable)
Enable or disable thread cpu time measurement via the ThreadMxMXBean.
|
static boolean |
setUsageThreshold(java.lang.String name,
long threshold)
Set usage threshold in MemoryPoolMXBean
|
static void |
setVerboseClassLoading(boolean verbose)
Set verbose class loading
|
static void |
setVerboseGarbageCollection(boolean verbose)
Set verbose garbage collection logging
|
public static boolean isThreadContentionMonitoringEnabled()
public static void setThreadContentionMonitoringEnabled(boolean enable)
enable
- whether to enable thread contention monitoringpublic static boolean isThreadCpuTimeEnabled()
public static void setThreadCpuTimeEnabled(boolean enable)
enable
- whether to enable thread cpu time measurementpublic static void resetPeakThreadCount()
public static void setVerboseClassLoading(boolean verbose)
verbose
- whether to enable verbose class loadingpublic static void setLoggerLevel(java.lang.String loggerName, java.lang.String levelName)
loggerName
- the name of the loggerlevelName
- the level to setpublic static void setVerboseGarbageCollection(boolean verbose)
verbose
- whether to enable verbose gc loggingpublic static void gc()
public static void resetPeakUsage(java.lang.String name)
name
- name of the MemoryPoolMXBean or "all"public static boolean setUsageThreshold(java.lang.String name, long threshold)
name
- name of the MemoryPoolMXBeanthreshold
- the threshold to setpublic static boolean setCollectionUsageThreshold(java.lang.String name, long threshold)
name
- name of the MemoryPoolMXBeanthreshold
- the collection threshold to setpublic static java.lang.String findDeadlock()
public static java.lang.String getThreadDump()
public static java.lang.String getThreadDump(java.util.Enumeration<java.util.Locale> requestedLocales)
requestedLocales
- list of locales to usepublic static java.lang.String getThreadDump(StringManager requestedSm)
requestedSm
- the StringManager to usepublic static java.lang.String getVMInfo()
public static java.lang.String getVMInfo(java.util.Enumeration<java.util.Locale> requestedLocales)
requestedLocales
- list of locales to usepublic static java.lang.String getVMInfo(StringManager requestedSm)
requestedSm
- the StringManager to useCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.