public class HealthUtils extends Object
| Constructor and Description |
|---|
HealthUtils() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
append(StringBuilder builder,
String caption,
Object value)
输出到
StringBuilder。 |
static void |
dumpSystemInfo()
将系统信息输出到
System.out中。 |
static void |
dumpSystemInfo(PrintWriter out)
将系统信息输出到指定
PrintWriter中。 |
static String |
get(String key)
获得System属性(调用System.getProperty)
|
static String |
get(String name,
boolean quiet)
取得系统属性,如果因为Java安全的限制而失败,则将错误打在Log中,然后返回
null。 |
static String |
get(String name,
String defaultValue)
取得系统属性,如果因为Java安全的限制而失败,则将错误打在Log中,然后返回
null。 |
static boolean |
getBoolean(String key,
boolean defaultValue)
获得boolean类型值
|
static ClassLoadingMXBean |
getClassLoadingMXBean()
返回Java虚拟机类加载系统相关属性
|
static CompilationMXBean |
getCompilationMXBean()
返回Java虚拟机编译系统相关属性
如果没有编译系统,则返回
null |
static long |
getCurrentPID()
获取当前进程 PID
|
static List<GarbageCollectorMXBean> |
getGarbageCollectorMXBeans()
Returns a list of
GarbageCollectorMXBean objects in the Java virtual machine. |
static HostInfo |
getHostInfo()
取得Host的信息。
|
static long |
getInt(String key,
int defaultValue)
获得int类型值
|
static JavaInfo |
getJavaInfo()
取得Java Implementation的信息。
|
static JavaRuntimeInfo |
getJavaRuntimeInfo()
取得当前运行的JRE的信息。
|
static JavaSpecInfo |
getJavaSpecInfo()
取得Java Specification的信息。
|
static JvmInfo |
getJvmInfo()
取得Java Virtual Machine Implementation的信息。
|
static JvmSpecInfo |
getJvmSpecInfo()
取得Java Virtual Machine Specification的信息。
|
static long |
getLong(String key,
long defaultValue)
获得long类型值
|
static List<MemoryManagerMXBean> |
getMemoryManagerMXBeans()
Returns a list of
MemoryManagerMXBean objects in the Java virtual machine. |
static MemoryMXBean |
getMemoryMXBean()
返回Java虚拟机内存系统相关属性
|
static List<MemoryPoolMXBean> |
getMemoryPoolMXBeans()
Returns a list of
MemoryPoolMXBean objects in the Java virtual machine. |
static OperatingSystemMXBean |
getOperatingSystemMXBean()
返回Java虚拟机运行下的操作系统相关信息属性
|
static OsInfo |
getOsInfo()
取得OS的信息。
|
static RuntimeInfo |
getRuntimeInfo()
取得Runtime的信息。
|
static RuntimeMXBean |
getRuntimeMXBean()
返回Java虚拟机运行时系统相关属性
|
static ThreadMXBean |
getThreadMXBean()
返回Java虚拟机线程系统相关属性
|
static UserInfo |
getUserInfo()
取得User的信息。
|
static Properties |
props() |
public static String get(String name, String defaultValue)
null。name - 属性名defaultValue - 默认值nullpublic static String get(String name, boolean quiet)
null。name - 属性名quiet - 安静模式,不将出错信息打在System.err中nullpublic static String get(String key)
key - 键public static boolean getBoolean(String key, boolean defaultValue)
key - 键defaultValue - 默认值public static long getInt(String key, int defaultValue)
key - 键defaultValue - 默认值public static long getLong(String key, long defaultValue)
key - 键defaultValue - 默认值public static Properties props()
public static long getCurrentPID()
public static ClassLoadingMXBean getClassLoadingMXBean()
ClassLoadingMXBeanpublic static MemoryMXBean getMemoryMXBean()
MemoryMXBeanpublic static ThreadMXBean getThreadMXBean()
ThreadMXBeanpublic static RuntimeMXBean getRuntimeMXBean()
RuntimeMXBeanpublic static CompilationMXBean getCompilationMXBean()
nullCompilationMXBean ,如果没有编译系统,则返回nullpublic static OperatingSystemMXBean getOperatingSystemMXBean()
OperatingSystemMXBeanpublic static List<MemoryPoolMXBean> getMemoryPoolMXBeans()
MemoryPoolMXBean objects in the Java virtual machine. The Java virtual machine can have first or more memory pools. It may add or remove memory pools during execution.public static List<MemoryManagerMXBean> getMemoryManagerMXBeans()
MemoryManagerMXBean objects in the Java virtual machine. The Java virtual machine can have first or more memory managers. It may add or remove memory managers during
execution.public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans()
GarbageCollectorMXBean objects in the Java virtual machine. The Java virtual machine may have first or more GarbageCollectorMXBean objects. It may add or remove
GarbageCollectorMXBean during execution.public static JvmSpecInfo getJvmSpecInfo()
JvmSpecInfo对象public static JvmInfo getJvmInfo()
JvmInfo对象public static JavaSpecInfo getJavaSpecInfo()
JavaSpecInfo对象public static JavaInfo getJavaInfo()
JavaInfo对象public static JavaRuntimeInfo getJavaRuntimeInfo()
JreInfo对象public static OsInfo getOsInfo()
OsInfo对象public static UserInfo getUserInfo()
UserInfo对象public static HostInfo getHostInfo()
HostInfo对象public static RuntimeInfo getRuntimeInfo()
RuntimeInfo对象public static void dumpSystemInfo()
System.out中。public static void dumpSystemInfo(PrintWriter out)
PrintWriter中。out - PrintWriter输出流protected static void append(StringBuilder builder, String caption, Object value)
StringBuilder。builder - StringBuilder对象caption - 标题value - 值Copyright © 2019. All rights reserved.