use of java.lang.management.GarbageCollectorMXBean in project gocd by gocd.
the class GCInformationProvider method asJson.
@Override
public Map<String, Object> asJson() {
List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
LinkedHashMap<String, Object> json = new LinkedHashMap<>();
for (GarbageCollectorMXBean gcBean : garbageCollectorMXBeans) {
LinkedHashMap<String, Object> gcBeanParms = new LinkedHashMap<>();
gcBeanParms.put("Memory Pool Names", Arrays.toString(gcBean.getMemoryPoolNames()));
gcBeanParms.put("Collection Count", gcBean.getCollectionCount());
gcBeanParms.put("Collection Time", gcBean.getCollectionTime());
json.put(gcBean.getName(), gcBeanParms);
}
return json;
}
use of java.lang.management.GarbageCollectorMXBean in project Payara by payara.
the class JVMGCStatsProvider method getCollectionTime.
@ManagedAttribute(id = "collectiontime-count")
@Description("approximate accumulated collection elapsed time in milliseconds")
public CountStatistic getCollectionTime() {
long times = -1;
int i = 0;
for (GarbageCollectorMXBean gcBean : gcBeanList) {
if (gcBean.getName().equals(gcName)) {
times = gcBean.getCollectionTime();
}
}
collectionTimeCount.setCount(times);
return collectionTimeCount;
}
use of java.lang.management.GarbageCollectorMXBean in project Payara by payara.
the class JVMStatsProviderBootstrap method postConstruct.
public void postConstruct() {
/* register with monitoring */
StatsProviderManager.register("jvm", PluginPoint.SERVER, "", sRuntimeStatsProvider, ContainerMonitoring.LEVEL_LOW);
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/class-loading-system", clStatsProvider, ContainerMonitoring.LEVEL_LOW);
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/compilation-system", compileStatsProvider, ContainerMonitoring.LEVEL_LOW);
for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
JVMGCStatsProvider jvmStatsProvider = new JVMGCStatsProvider(gc.getName());
jvmStatsProviderList.add(jvmStatsProvider);
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/garbage-collectors/" + gc.getName(), jvmStatsProvider, ContainerMonitoring.LEVEL_LOW);
}
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/memory", memoryStatsProvider, ContainerMonitoring.LEVEL_LOW);
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/operating-system", osStatsProvider, ContainerMonitoring.LEVEL_LOW);
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/runtime", runtimeStatsProvider, ContainerMonitoring.LEVEL_LOW);
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/thread-system", threadSysStatsProvider, ContainerMonitoring.LEVEL_LOW);
for (ThreadInfo t : threadBean.getThreadInfo(threadBean.getAllThreadIds(), 5)) {
// See issue #12636
if (t == null)
continue;
JVMThreadInfoStatsProvider threadInfoStatsProvider = new JVMThreadInfoStatsProvider(t);
StatsProviderManager.register("jvm", PluginPoint.SERVER, "jvm/thread-system/thread-" + t.getThreadId(), threadInfoStatsProvider, ContainerMonitoring.LEVEL_HIGH);
}
}
use of java.lang.management.GarbageCollectorMXBean in project incubator-systemml by apache.
the class Statistics method getJVMgcTime.
public static long getJVMgcTime() {
long ret = 0;
List<GarbageCollectorMXBean> gcxs = ManagementFactory.getGarbageCollectorMXBeans();
for (GarbageCollectorMXBean gcx : gcxs) ret += gcx.getCollectionTime();
if (ret > 0)
ret += jvmGCTime;
return ret;
}
use of java.lang.management.GarbageCollectorMXBean in project incubator-systemml by apache.
the class Statistics method getJVMgcCount.
public static long getJVMgcCount() {
long ret = 0;
List<GarbageCollectorMXBean> gcxs = ManagementFactory.getGarbageCollectorMXBeans();
for (GarbageCollectorMXBean gcx : gcxs) ret += gcx.getCollectionCount();
if (ret > 0)
ret += jvmGCCount;
return ret;
}
Aggregations