let's assume that I have a large system which uses Scala Global Execution Context in many places to execute different Futures. And one day in this system occurred the performance problem (Memory dump analysis pointed out that the reason was too many Futures in GEC). I found the reason quickly because I was lucky, but this caused that I started to think about possibilities to monitor the execution contexts state.
It's not easy and I can't find articles about that topic. I hacked GEC and now it exposes few parameters via JMX (QueuedSubmissionCount, QueuedCount etc), but it is still not enough to tell which class caused the leak.
I thought about a custom wrapper for Execution Context, which will take an additional identifier (class name or something) and counts the number of futures per identifier. But I believe that many programmers have the same problem and maybe you have some better idea?