registry.register(
name(Utils.DEFAULT_METRIC_PREFIX, this.getClass().getSimpleName(), "executor-" + count++, "pendingTasks"),
new Gauge<Integer>() {
@Override
public Integer getValue() {
return executor.pendingTasks();
}
});
} catch (IllegalArgumentException e) {
// Assume this is due to multiple instances
}