Gitlab Community Edition Instance

Commit bc1ecc39 authored by mhellka's avatar mhellka
Browse files

Changed adn added default metrics

parent 3dfd1fe3
......@@ -29,12 +29,14 @@ public class DefaultMetricsAndHealthChecks implements RuntimeListener {
final MetricRegistry metrics = runtime.lookupRequired(MetricRegistry.class);
final ThreadMXBean tmbean = ManagementFactory.getThreadMXBean();
metrics.gauge("jvm.threads.current", () -> () -> tmbean.getThreadCount());
metrics.gauge("jvm.threads.deamon", () -> () -> tmbean.getDaemonThreadCount());
metrics.gauge("jvm.threads.all", () -> () -> tmbean.getThreadCount());
metrics.gauge("jvm.threads.peak", () -> () -> tmbean.getPeakThreadCount());
metrics.gauge("jvm.threads.total", () -> () -> tmbean.getTotalStartedThreadCount());
final OperatingSystemMXBean osbean = ManagementFactory.getOperatingSystemMXBean();
metrics.gauge("jvm.os.load", () -> () -> osbean.getSystemLoadAverage());
metrics.gauge("jvm.os.loadScaled", () -> () -> osbean.getSystemLoadAverage() / osbean.getAvailableProcessors());
metrics.gauge("jvm.os.cpu", () -> () -> osbean.getAvailableProcessors());
final RuntimeMXBean vmbean = ManagementFactory.getRuntimeMXBean();
metrics.gauge("jvm.vm.uptimeMS", () -> () -> vmbean.getUptime());
......@@ -46,6 +48,7 @@ public class DefaultMetricsAndHealthChecks implements RuntimeListener {
metrics.gauge("jvm.offheap.max", () -> () -> mbean.getNonHeapMemoryUsage().getMax());
metrics.gauge("jvm.offheap.used", () -> () -> mbean.getNonHeapMemoryUsage().getUsed());
metrics.gauge("jvm.offheap.res", () -> () -> mbean.getNonHeapMemoryUsage().getCommitted());
metrics.gauge("jvm.fincount", () -> () -> mbean.getObjectPendingFinalizationCount());
health.register("jvm.threads.deadlock", () -> {
final long[] deadlocks = tmbean.findDeadlockedThreads();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment