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?
Asked
Active
Viewed 526 times
0
RAGHHURAAMM
- 1,101
- 5
- 14
longliveenduro
- 2,059
- 19
- 37
1 Answers
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?
prayagupa
- 28,818
- 13
- 146
- 190
-
1Thanks, lead me to the solution. I used jstack -l which needs no front end and the actual naming of the threads is "ForkJoinPool-x-worker-y" – longliveenduro Oct 11 '18 at 12:21
-
The question was about tasks - i.e. Futures. How does information about threads help count the number of pending tasks? – pdxleif Sep 16 '21 at 04:35