线程池执行程序监视要求 [英] Thread Pool Executor Monitoring Requirement

查看:131
本文介绍了线程池执行程序监视要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的生产环境中,我们使用Thread Pool Executor来执行runntable任务。我需要为线程池执行器服务开发一个线程池心跳监视系统:

In our production environments, we are using Thread Pool Executor to execute runntable task. I need to develop a Thread pool Heartbeat a monitoring system for Thread pool Executor Service:

每60秒,需要收集关于线程池执行器的以下统计信息:

Every 60 seconds, the requirement is to collect following statistic about the Thread Pooled Executor:

1)线程池的大小

2)等待线程的队列长度(持续时间或时间)任务在线程执行前在阻塞队列中等待)

2) length of queue waiting for a thread (a duration or time task waited in blocking queue before thread executed )

3)上一次心跳间隔期间队列中的平均等待时间

3) Average wait time in queue during the last heartbeat interval

4)当前活动线程

5)当前非活动线程。

5) Current non active threads.

我想知道有没有现有框架或线程池执行器服务,它将提供上述报告要求。

I wanted to know is there any existing framework or Thread pool Executor Service which will provide above reporting requirements.

谢谢,

BMis13

推荐答案

你在使用Spring吗?如果我没弄错,Spring的ThreadPoolExecutor实现支持JMX。

Are you using Spring? If I'm not mistaken Spring's implementation of ThreadPoolExecutor supports JMX.

这篇关于线程池执行程序监视要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆