public class Diagnostics extends Object
Constructor and Description |
---|
Diagnostics() |
Modifier and Type | Method and Description |
---|---|
static String |
findDeadlock()
Check if any threads are deadlocked.
|
static void |
gc()
Initiate garbage collection via MX Bean
|
static String |
getThreadDump()
Retrieves a formatted JVM thread dump.
|
static String |
getThreadDump(Enumeration<Locale> requestedLocales)
Retrieves a formatted JVM thread dump.
|
static String |
getThreadDump(StringManager requestedSm)
Retrieve a JVM thread dump formatted
using the given StringManager.
|
static String |
getVMInfo()
Retrieves a formatted JVM information text.
|
static String |
getVMInfo(Enumeration<Locale> requestedLocales)
Retrieves a formatted JVM information text.
|
static 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(String name)
Reset peak memory usage data in MemoryPoolMXBean
|
static boolean |
setCollectionUsageThreshold(String name,
long threshold)
Set collection usage threshold in MemoryPoolMXBean
|
static void |
setLoggerLevel(String loggerName,
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(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(String loggerName, 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(String name)
name
- name of the MemoryPoolMXBean or "all"public static boolean setUsageThreshold(String name, long threshold)
name
- name of the MemoryPoolMXBeanthreshold
- the threshold to setpublic static boolean setCollectionUsageThreshold(String name, long threshold)
name
- name of the MemoryPoolMXBeanthreshold
- the collection threshold to setpublic static String findDeadlock()
public static String getThreadDump()
public static String getThreadDump(Enumeration<Locale> requestedLocales)
requestedLocales
- list of locales to usepublic static String getThreadDump(StringManager requestedSm)
requestedSm
- the StringManager to usepublic static String getVMInfo()
public static String getVMInfo(Enumeration<Locale> requestedLocales)
requestedLocales
- list of locales to usepublic static String getVMInfo(StringManager requestedSm)
requestedSm
- the StringManager to useCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.