public static double processCpuLoad() { if (oracleJVMAndUnix) { UnixOperatingSystemMXBean unix = (UnixOperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); return unix.getProcessCpuLoad(); } else { return -1; } }
public static long totalPhysicalMemorySize() { if (oracleJVMAndUnix) { UnixOperatingSystemMXBean unix = (UnixOperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); return unix.getTotalPhysicalMemorySize(); } else { return -1; } }
public static long freeSwapSpaceSize() { if (oracleJVMAndUnix) { UnixOperatingSystemMXBean unix = (UnixOperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); return unix.getFreeSwapSpaceSize(); } else { return -1; } }
public static long committedVirtualMemorySize() { if (oracleJVMAndUnix) { UnixOperatingSystemMXBean unix = (UnixOperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); return unix.getCommittedVirtualMemorySize(); } else { return -1; } }
public static long openFileDescriptorCount() { if (oracleJVMAndUnix) { UnixOperatingSystemMXBean unix = (UnixOperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); return unix.getOpenFileDescriptorCount(); } else { return -1; } }
private void calPerf() { this.bytesRead = (long) (vol.getReadBytes() - this.pbytesRead); this.pbytesRead = vol.getReadBytes(); MDC.put("bytesRead", Long.toString(bytesRead)); this.bytesWritten = (long) (vol.getActualWriteBytes() - this.pbytesWritten); this.pbytesWritten = vol.getActualWriteBytes(); MDC.put("bytesWritten", Long.toString(this.bytesWritten)); this.duplicateBytes = (long) (vol.getDuplicateBytes() - this.pduplicateBytes); this.pduplicateBytes = vol.getDuplicateBytes(); MDC.put("duplicateBytes", Long.toString(this.duplicateBytes)); this.virtualBytesWritten = (long) (vol.getVirtualBytesWritten() - this.pvirtualBytesWritten); this.pvirtualBytesWritten = vol.getVirtualBytesWritten(); MDC.put("virtualBytesWritten", Long.toString(this.virtualBytesWritten)); this.RIOPS = (long) (vol.getReadOperations() - this.pRIOPS); this.pRIOPS = vol.getReadOperations(); MDC.put("RIOPS", Long.toString(this.RIOPS)); this.WIOPS = (long) (vol.getWriteOperations() - this.pWIOPS); this.pWIOPS = vol.getWriteOperations(); this.dseSz = HCServiceProxy.getDSESize(); this.dseCompSz = HCServiceProxy.getDSECompressedSize(); MDC.put("dseSz", Long.toString(this.dseSz)); MDC.put("dseCompSz", Long.toString(this.dseCompSz)); MDC.put("WIOPS", Long.toString(this.WIOPS)); MDC.put("sdfsCpuLoad", Double.toString(perf.getProcessCpuLoad())); MDC.put("sdfsCpuTime", Double.toString(perf.getProcessCpuTime())); MDC.put("systemCpuLoad", Double.toString(perf.getSystemCpuLoad())); MDC.put("systemCpuAverage", Double.toString(perf.getSystemLoadAverage())); MDC.put("freeMemory", Long.toString(perf.getFreePhysicalMemorySize())); MDC.put("totalMemory", Long.toString(perf.getTotalPhysicalMemorySize())); MDC.put("freeSwap", Long.toString(perf.getFreeSwapSpaceSize())); MDC.put("totalSwap", Long.toString(perf.getTotalSwapSpaceSize())); log.info(vol.getName()); MDC.clear(); }