@Override public void install() { self = DefaultMonitorComponent.bind(this, name); registry.register(MetricRegistry.name("nuxeo", "repositories", name, "connections", "count"), new JmxAttributeGauge(self.name, "ConnectionCount")); registry.register(MetricRegistry.name("nuxeo", "repositories", name, "connections", "idle"), new JmxAttributeGauge(self.name, "IdleConnectionCount")); registry.register(MetricRegistry.name("nuxeo", "repositories", name, "connections", "killed"), new JmxAttributeGauge(self.name, "KilledActiveConnectionCount")); }
@Override public Object getValue() { try { return mBeanServerConn.getAttribute(getObjectName(), attributeName); } catch (IOException | JMException e) { return null; } }
@Override public void install() { self = DefaultMonitorComponent.bind(CoreSessionMonitor.class, this); registry.register(MetricRegistry.name("nuxeo.repositories", "sessions"), new JmxAttributeGauge(self.name, "Count")); }
@Override public Map<String, Metric> getMetrics() { final Map<String, Metric> gauges = new HashMap<>(); for (String pool : POOLS) { for (int i = 0; i < ATTRIBUTES.length; i++) { final String attribute = ATTRIBUTES[i]; final String name = NAMES[i]; try { final ObjectName on = new ObjectName("java.nio:type=BufferPool,name=" + pool); mBeanServer.getMBeanInfo(on); gauges.put(name(pool, name), new JmxAttributeGauge(mBeanServer, on, attribute)); } catch (JMException ignored) { LOGGER.debug("Unable to load buffer pool MBeans, possibly running on Java 6"); } } } return Collections.unmodifiableMap(gauges); } }
new JmxAttributeGauge(jmxMetricName, "EnqueueCount") ); environment.metrics().register( dwMetricName + ".dequeueCount", new JmxAttributeGauge(jmxMetricName, "DequeueCount") ); }));