import static com.codahale.metrics.MetricRegistry.name;
public class InstrumentedQueuedThreadPool extends QueuedThreadPool {
public InstrumentedQueuedThreadPool(MetricRegistry registry) {
super();
registry.register(name(QueuedThreadPool.class, "percent-idle"), new RatioGauge() {
@Override
protected Ratio getRatio() {
return Ratio.of(getIdleThreads(),
getThreads());
}