ExecutionContextExecutor“scala.concurrent.ExecutionContext.Implicits.global"的监控队列 [英] Monitoring queue of ExecutionContextExecutor "scala.concurrent.ExecutionContext.Implicits.global"
问题描述
有没有办法监控scala.concurrent.ExecutionContext.Implicits.global
的任务队列?即,查看等待线程释放的任务数?
JDK 与 jconsole
和 jmc
一起提供.您可以使用它们来查看线程使用情况.你可以看到,
- 线程状态,
- 阻止计数
- 线程分配的字节等
scala 隐式线程名称以 scala-execution-context-global-n
开头.
jmc
截图:
相关:在执行上下文中获取后台运行的期货数量的最佳方法是什么?>
Is there any way to monitor the task queue of scala.concurrent.ExecutionContext.Implicits.global
? ie., see the number of tasks waiting for a thread to be released?
JDK comes along with jconsole
and jmc
. You can use them to see thread usage. You can see,
- Thread state,
- blocked count
- thread allocated bytes etc
scala implicit threads name start with scala-execution-context-global-n
.
jmc
screenshot:
Related: what is the best way to get the number of futures running in background in an execution context?
这篇关于ExecutionContextExecutor“scala.concurrent.ExecutionContext.Implicits.global"的监控队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!