|
|
|
@ -61,20 +61,16 @@ public class PrometheusMonitorHandler extends AbstractDynamicThreadPoolMonitor {
|
|
|
|
|
Iterable<Tag> tags = Lists.newArrayList(
|
|
|
|
|
Tag.of(DYNAMIC_THREAD_POOL_ID_TAG, poolRunStateInfo.getTpId()),
|
|
|
|
|
Tag.of(APPLICATION_NAME_TAG, applicationName));
|
|
|
|
|
// load
|
|
|
|
|
Metrics.gauge(metricName("current.load"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getSimpleCurrentLoad);
|
|
|
|
|
Metrics.gauge(metricName("peak.load"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getSimplePeakLoad);
|
|
|
|
|
// thread pool
|
|
|
|
|
Metrics.gauge(metricName("core.size"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getCoreSize);
|
|
|
|
|
Metrics.gauge(metricName("maximum.size"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getMaximumSize);
|
|
|
|
|
Metrics.gauge(metricName("current.size"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getPoolSize);
|
|
|
|
|
Metrics.gauge(metricName("largest.size"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getLargestPoolSize);
|
|
|
|
|
Metrics.gauge(metricName("active.size"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getActiveSize);
|
|
|
|
|
// queue
|
|
|
|
|
Metrics.gauge(metricName("queue.size"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getQueueSize);
|
|
|
|
|
Metrics.gauge(metricName("queue.capacity"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getQueueCapacity);
|
|
|
|
|
Metrics.gauge(metricName("queue.remaining.capacity"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getQueueRemainingCapacity);
|
|
|
|
|
// other
|
|
|
|
|
Metrics.gauge(metricName("completed.task.count"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getCompletedTaskCount);
|
|
|
|
|
Metrics.gauge(metricName("reject.count"), tags, poolRunStateInfo, ThreadPoolRunStateInfo::getRejectCount);
|
|
|
|
|
}
|
|
|
|
|