Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.metrics.jetty;
 
 
 
    public InstrumentedQueuedThreadPool() {
        this(Metrics.defaultRegistry());
    }
    public InstrumentedQueuedThreadPool(MetricsRegistry registry) {
        super();
        registry.newGauge(QueuedThreadPool.class"percent-idle"new RatioGauge() {
            @Override
            protected double getNumerator() {
                return getIdleThreads();
            }
            @Override
            protected double getDenominator() {
                return getThreads();
            }
        });
        registry.newGauge(QueuedThreadPool.class"active-threads"new Gauge<Integer>() {
            @Override
            public Integer value() {
                return getThreads();
            }
        });
        registry.newGauge(QueuedThreadPool.class"idle-threads"new Gauge<Integer>() {
            @Override
            public Integer value() {
                return getIdleThreads();
            }
        });
    }
New to GrepCode? Check out our FAQ X