Package com.codahale.metrics

Examples of com.codahale.metrics.JmxAttributeGauge


        if (scope != null) {
            name = MetricRegistry.name(name, scope);
        }
        MetricRegistry reg = Metrics.getRegistry();
        hitCount = reg.register(MetricRegistry.name(name, "Hit Count"),
                new JmxAttributeGauge(nameObj, "HitCount"));
        hitRate = reg.register(MetricRegistry.name(name, "Hit Rate"),
                new JmxAttributeGauge(nameObj, "HitRate"));
        loadCount = reg.register(MetricRegistry.name(name, "Load Count"),
                new JmxAttributeGauge(nameObj, "LoadCount"));
        missRate = reg.register(MetricRegistry.name(name, "Miss Rate"),
                new JmxAttributeGauge(nameObj, "MissRate"));
        requestCount = reg.register(MetricRegistry.name(name, "Request Count"),
                new JmxAttributeGauge(nameObj, "RequestCount"));
        totalLoadTime = reg.register(MetricRegistry.name(name, "Total Load Time"),
                new JmxAttributeGauge(nameObj, "TotalLoadTime"));
    }
View Full Code Here


            final ObjectName nameObj = new ObjectName(name);
            mbs.registerMBean(this, nameObj);
            MetricRegistry reg = Metrics.getRegistry();

            lockDisinterestedTimeMillisGauge = reg.register(MetricRegistry.name(ZKBasedShardLockManager.class, "Lock Disinterested Time Millis"),
                    new JmxAttributeGauge(nameObj, "LockDisinterestedTimeMillis"));
            minLockHoldTimeMillisGauge = reg.register(MetricRegistry.name(ZKBasedShardLockManager.class, "Min Lock Hold Time Millis"),
                    new JmxAttributeGauge(nameObj, "MinLockHoldTimeMillis"));
            secondsSinceLastScavengeGauge = reg.register(MetricRegistry.name(ZKBasedShardLockManager.class, "Seconds Since Last Scavenge"),
                    new JmxAttributeGauge(nameObj, "SecondsSinceLastScavenge"));

            zkConnectionStatusGauge = reg.register(MetricRegistry.name(ZKBasedShardLockManager.class, "Zk Connection Status"),
                    new JmxAttributeGauge(nameObj, "ZkConnectionStatus") {
                        @Override
                        public Object getValue() {
                            Object val = super.getValue();
                            if (val.equals("connected")) {
                                return 1;
View Full Code Here

    }

    private static void registerJmxKeyAsMetric(final MetricRegistry metricRegistry, final String metricGroup,
                                               final String jmxObjectName, final String jmxAttributeName) throws MalformedObjectNameException  {
        metricRegistry.register(MetricRegistry.name("rexpro", "core", metricGroup, jmxAttributeName),
                new JmxAttributeGauge(new ObjectName(jmxObjectName), jmxAttributeName));
    }
View Full Code Here

    }

    private static void registerJmxKeyAsMetric(final MetricRegistry metricRegistry, final String metricGroup,
                                               final String jmxObjectName, final String jmxAttributeName) throws MalformedObjectNameException  {
        metricRegistry.register(MetricRegistry.name("http", "core", metricGroup, jmxAttributeName),
                new JmxAttributeGauge(new ObjectName(jmxObjectName), jmxAttributeName));
    }
View Full Code Here

                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");
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.codahale.metrics.JmxAttributeGauge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.