use of org.apache.servicecomb.core.executor.ThreadPoolExecutorEx in project java-chassis by ServiceComb.
the class ThreadPoolMetersInitializer method createThreadPoolMeters.
protected void createThreadPoolMeters(String threadPoolName, Executor executor) {
if (!ThreadPoolExecutor.class.isInstance(executor)) {
return;
}
ThreadPoolMonitor.attach(registry, (ThreadPoolExecutor) executor, threadPoolName);
if (executor instanceof ThreadPoolExecutorEx) {
Tag idTag = new BasicTag("id", threadPoolName);
PolledMeter.using(registry).withName(REJECTED_COUNT).withTag(idTag).monitorMonotonicCounter((ThreadPoolExecutorEx) executor, ThreadPoolExecutorEx::getRejectedCount);
}
}
Aggregations