public class TPerformance extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TPerformance.MemoryInfo
内存信息对象
|
static class |
TPerformance.MEMTYPE
内存信息类型枚举
|
static class |
TPerformance.ObjectInfo
JVM 中对象信息
|
Constructor and Description |
---|
TPerformance() |
Modifier and Type | Method and Description |
---|---|
static String |
convertByteMac(byte[] macBytes)
将 byte[]形式的 mac 地址, 转换为字符串形式的 mac 地址
|
static double |
cpuPerCoreLoadAvg()
获取系统单 CPU 核心的平均负载
|
static Map<String,String> |
getJVMGCInfo()
获取当前进程的 GC 信息
|
static Map<String,String> |
getJVMGCInfo(long pid)
获取指定进程的 GC 信息
|
static Map<String,Object> |
getJVMInfo()
获取JVM信息
|
static TPerformance.MemoryInfo |
getJVMMemoryInfo()
获取当前内存信息
|
static long |
getJVMMemoryInfo(TPerformance.MEMTYPE memType)
获取部分内存信息(栈,非栈)
|
static double |
getJVMMemoryUsage()
JVM 虚拟机的内存使用情况
|
static Map<String,TPerformance.ObjectInfo> |
getJVMObjectInfo(long pid,
String regex)
获取指定进程的对象信息
|
static Map<String,TPerformance.ObjectInfo> |
getJVMObjectInfo(long pid,
String regex,
Integer headCount)
获取指定进程的对象信息
|
static Map<String,TPerformance.ObjectInfo> |
getJVMObjectInfo(String regex,
int headCount)
获取当前JVM加载的对象信息(数量,所占内存大小)
|
static List<String> |
getLocalIpAddrs()
获取所有的本机 ip 地址
|
static byte[] |
getMacByAddress(String address)
获取某个ip 地址的 mac 地址
|
static List<NetworkInterface> |
getNetworkInterfaces()
获取主机所有的网络接口
|
static double |
getProcessCpuUsage()
获取当前进程 cpu 使用量
|
static int |
getProcessorCount()
获取当前系统 CPU 数
|
static Map<String,Object> |
getProcessorInfo()
获取处理器信息
|
static double |
getSystemLoadAverage()
获取当前系统的负载情况
|
static List<Map<String,Object>> |
getThreadDetail(String state,
boolean withStack)
获取当前 JVM 线程信息描述
|
static Map<String,Object> |
getThreadPoolInfo()
获取当前 JVM 线程信息描述
|
public static double getSystemLoadAverage()
public static int getProcessorCount()
public static List<NetworkInterface> getNetworkInterfaces()
public static String convertByteMac(byte[] macBytes)
macBytes
- mac 地址字节数组public static List<String> getLocalIpAddrs()
public static byte[] getMacByAddress(String address)
address
- ip 地址public static double cpuPerCoreLoadAvg()
public static double getProcessCpuUsage()
public static double getJVMMemoryUsage()
public static long getJVMMemoryInfo(TPerformance.MEMTYPE memType)
memType
- 获取的信息类型public static TPerformance.MemoryInfo getJVMMemoryInfo()
public static Map<String,String> getJVMGCInfo(long pid) throws IOException
pid
- 进程 IdIOException
- IO 异常public static Map<String,String> getJVMGCInfo() throws IOException
IOException
- IO 异常public static Map<String,TPerformance.ObjectInfo> getJVMObjectInfo(long pid, String regex, Integer headCount) throws IOException
pid
- 进程 Idregex
- 对象匹配字符串headCount
- 返回的对象数IOException
- IO 异常public static Map<String,TPerformance.ObjectInfo> getJVMObjectInfo(long pid, String regex) throws IOException
pid
- 进程 Idregex
- 对象匹配字符串IOException
- IO 异常public static Map<String,TPerformance.ObjectInfo> getJVMObjectInfo(String regex, int headCount)
regex
- 正则表达式headCount
- 头部记录数public static Map<String,Object> getThreadPoolInfo()
public static List<Map<String,Object>> getThreadDetail(String state, boolean withStack)
state
- 线程状态, nul,返回所有状态的线程withStack
- 是否包含堆栈信息Copyright © 2020 Voovan. All rights reserved.