| | |
| | | status.memory.nonheapMemoryUsage_used = nonheapMemoryUsage.getUsed(); |
| | | status.memory.nonheapMemoryUsage_committed = nonheapMemoryUsage.getCommitted(); |
| | | |
| | | status.memory.usedMemory = status.memory.heapMemoryUsage_committed + status.memory.nonheapMemoryUsage_used; // status.memory.heapMemoryUsage_init |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); |
| | | if (status.thread == null) status.thread = new ApplicationStatusThread(); |
| | | status.thread.timestamp = timestamp; |
| | | |
| | | long[] threadsid = threadMXBean.getAllThreadIds(); |
| | | long threadCpuTime = 0; |
| | | long threadUserTime = 0; |
| | | |
| | | for (long threadid : threadsid) |
| | | { |
| | | try |
| | | { |
| | | long currentThreadCpuTime = threadMXBean.getThreadCpuTime(threadid); |
| | | long currentThreadUserTime = threadMXBean.getThreadUserTime(threadid); |
| | | if (currentThreadCpuTime > 0) threadCpuTime = threadCpuTime + currentThreadCpuTime; |
| | | if (currentThreadUserTime > 0) threadUserTime = threadUserTime + currentThreadUserTime; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | } |
| | | } |
| | | |
| | | status.thread.threadCpuTime = threadCpuTime; |
| | | status.thread.threadUserTime = threadUserTime; |
| | | status.thread.totalStartedThreadCount = threadMXBean.getTotalStartedThreadCount(); |
| | | status.thread.threadCount = threadMXBean.getThreadCount(); |
| | | status.thread.peakThreadCount = threadMXBean.getPeakThreadCount(); |
| | |
| | | status.system.freePhysicalMemorySize = operatingSystemMXBean.getFreePhysicalMemorySize(); |
| | | status.system.freeSwapSpaceSize = operatingSystemMXBean.getFreeSwapSpaceSize(); |
| | | status.system.processCpuLoad = operatingSystemMXBean.getProcessCpuLoad(); |
| | | status.system.processCpuTime = operatingSystemMXBean.getProcessCpuTime(); |
| | | status.system.processCpuTime = operatingSystemMXBean.getProcessCpuTime() / operatingSystemMXBean.getAvailableProcessors(); |
| | | status.system.systemCpuLoad = operatingSystemMXBean.getSystemCpuLoad(); |
| | | status.system.totalPhysicalMemorySize = operatingSystemMXBean.getTotalPhysicalMemorySize(); |
| | | status.system.totalSwapSpaceSize = operatingSystemMXBean.getTotalSwapSpaceSize(); |
| | | status.system.systemLoadAverage = operatingSystemMXBean.getSystemLoadAverage(); |
| | | status.system.systemLoadAverage = operatingSystemMXBean.getSystemLoadAverage() / operatingSystemMXBean.getAvailableProcessors(); |
| | | status.system.availableProcessors = operatingSystemMXBean.getAvailableProcessors(); |
| | | status.system.totalPhysicalMemorySize = operatingSystemMXBean.getTotalPhysicalMemorySize(); |
| | | status.system.systemLoadAverage = this.processorPercentage; |