@Override public long getSpanFullGCCollectionCount() { long current = getFullGCCollectionCount(); if (lastFullGCCollectionCount == -1) { lastFullGCCollectionCount = current; return 0; } else { long result = current - lastFullGCCollectionCount; lastFullGCCollectionCount = current; return result; } }
@Override public long getSpanFullGCCollectionTime() { long current = getFullGCCollectionTime(); if (lastFullGCCollectionTime == -1) { lastFullGCCollectionTime = current; return 0; } else { long result = current - lastFullGCCollectionTime; lastFullGCCollectionTime = current; return result; } }
@Override public long getSpanYoungGCCollectionCount() { long current = getYoungGCCollectionCount(); if (lastYoungGCCollectionCount == -1) { lastYoungGCCollectionCount = current; return 0; } else { long result = current - lastYoungGCCollectionCount; lastYoungGCCollectionCount = current; return result; } }
@Override public long getSpanYoungGCCollectionTime() { long current = getYoungGCCollectionTime(); if (lastYoungGCCollectionTime == -1) { lastYoungGCCollectionTime = current; return 0; } else { long result = current - lastYoungGCCollectionTime; lastYoungGCCollectionTime = current; return result; } }
public static void start() { getRefCount().incrementAndGet(); if (start.compareAndSet(false, true)) { if (CollectionUtils.isEmpty(MONITOR_MAP)) { MONITOR_MAP.put(JVMConstants.JMX_JVM_INFO_NAME, JVMInfo.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_MEMORY_NAME, JVMMemory.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_GC_NAME, JVMGC.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_THREAD_NAME, JVMThread.getInstance()); } try { for (Map.Entry<String, Object> entry : MONITOR_MAP.entrySet()) { ObjectName objectName = new ObjectName(entry.getKey()); if (!MBEAN_SERVER.isRegistered(objectName)) { MBEAN_SERVER.registerMBean(entry.getValue(), objectName); } } LOGGER.info("Start JVMMonitor succeed "); } catch (Exception e) { LOGGER.error("Start JVMMonitor error ", e); } } }
@Override public long getSpanYoungGCCollectionTime() { long current = getYoungGCCollectionTime(); if (lastYoungGCCollectionTime == -1) { lastYoungGCCollectionTime = current; return 0; } else { long result = current - lastYoungGCCollectionTime; lastYoungGCCollectionTime = current; return result; } }
public static void start() { getRefCount().incrementAndGet(); if (start.compareAndSet(false, true)) { if (CollectionUtils.isEmpty(MONITOR_MAP)) { MONITOR_MAP.put(JVMConstants.JMX_JVM_INFO_NAME, JVMInfo.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_MEMORY_NAME, JVMMemory.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_GC_NAME, JVMGC.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_THREAD_NAME, JVMThread.getInstance()); } try { for (Map.Entry<String, Object> entry : MONITOR_MAP.entrySet()) { ObjectName objectName = new ObjectName(entry.getKey()); if (!MBEAN_SERVER.isRegistered(objectName)) { MBEAN_SERVER.registerMBean(entry.getValue(), objectName); } } LOGGER.info("Start JVMMonitor succeed "); } catch (Exception e) { LOGGER.error("Start JVMMonitor error ", e); } } }
@Override public long getSpanYoungGCCollectionCount() { long current = getYoungGCCollectionCount(); if (lastYoungGCCollectionCount == -1) { lastYoungGCCollectionCount = current; return 0; } else { long result = current - lastYoungGCCollectionCount; lastYoungGCCollectionCount = current; return result; } }
@Override public long getSpanFullGCCollectionTime() { long current = getFullGCCollectionTime(); if (lastFullGCCollectionTime == -1) { lastFullGCCollectionTime = current; return 0; } else { long result = current - lastFullGCCollectionTime; lastFullGCCollectionTime = current; return result; } }
@Override public long getSpanFullGCCollectionCount() { long current = getFullGCCollectionCount(); if (lastFullGCCollectionCount == -1) { lastFullGCCollectionCount = current; return 0; } else { long result = current - lastFullGCCollectionCount; lastFullGCCollectionCount = current; return result; } }
@Override public long getSpanYoungGCCollectionTime() { long current = getYoungGCCollectionTime(); if (lastYoungGCCollectionTime == -1) { lastYoungGCCollectionTime = current; return 0; } else { long result = current - lastYoungGCCollectionTime; lastYoungGCCollectionTime = current; return result; } }
public static void start() { getRefCount().incrementAndGet(); if (start.compareAndSet(false, true)) { if (CollectionUtils.isEmpty(MONITOR_MAP)) { MONITOR_MAP.put(JVMConstants.JMX_JVM_INFO_NAME, JVMInfo.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_MEMORY_NAME, JVMMemory.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_GC_NAME, JVMGC.getInstance()); MONITOR_MAP.put(JVMConstants.JMX_JVM_THREAD_NAME, JVMThread.getInstance()); } try { for (Map.Entry<String, Object> entry : MONITOR_MAP.entrySet()) { ObjectName objectName = new ObjectName(entry.getKey()); if (!MBEAN_SERVER.isRegistered(objectName)) { MBEAN_SERVER.registerMBean(entry.getValue(), objectName); } } LOGGER.info("Start JVMMonitor succeed "); } catch (Exception e) { LOGGER.error("Start JVMMonitor error ", e); } } }
@Override public long getSpanYoungGCCollectionCount() { long current = getYoungGCCollectionCount(); if (lastYoungGCCollectionCount == -1) { lastYoungGCCollectionCount = current; return 0; } else { long result = current - lastYoungGCCollectionCount; lastYoungGCCollectionCount = current; return result; } }
@Override public long getSpanFullGCCollectionTime() { long current = getFullGCCollectionTime(); if (lastFullGCCollectionTime == -1) { lastFullGCCollectionTime = current; return 0; } else { long result = current - lastFullGCCollectionTime; lastFullGCCollectionTime = current; return result; } }
@Override public long getSpanFullGCCollectionCount() { long current = getFullGCCollectionCount(); if (lastFullGCCollectionCount == -1) { lastFullGCCollectionCount = current; return 0; } else { long result = current - lastFullGCCollectionCount; lastFullGCCollectionCount = current; return result; } }