Monitoring queue of ExecutionContextExecutor “scala.concurrent.ExecutionContext.Implicits.global”

无人久伴 提交于 2019-12-25 00:47:08

问题


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?


回答1:


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?



来源:https://stackoverflow.com/questions/52759431/monitoring-queue-of-executioncontextexecutor-scala-concurrent-executioncontext

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!