ExecutionContextExecutor“scala.concurrent.ExecutionContext.Implicits.global"的监控队列 [英] Monitoring queue of ExecutionContextExecutor "scala.concurrent.ExecutionContext.Implicits.global"

查看:46
本文介绍了ExecutionContextExecutor“scala.concurrent.ExecutionContext.Implicits.global"的监控队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法监控scala.concurrent.ExecutionContext.Implicits.global的任务队列?即,查看等待线程释放的任务数?

解决方案

JDK 与 jconsolejmc 一起提供.您可以使用它们来查看线程使用情况.你可以看到,

  • 线程状态,
  • 阻止计数
  • 线程分配的字节等

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屋!

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