Stream monitoring for scala members

Is there a way to keep track of how many threads are really alive and working with my scala members?

+3
source share
2 answers

The only way to do this correctly is to add your own artist for the actor subsystem, since by default actor threads do not have actor- or scala-specific names (they can simply be called Thread-Nor pool-N-thread-Mdepending on the version of Scala used.

Philip Haller gave instructions for using your own artist, where you can track the use of streams if you want, or at least the name of the streams created in this way. If you redefine thread naming, you can use the standard Java MBeans system (i.e. ThreadMXBean ) to program threads (or through JConsole / JVisualVM).

Please note that you can control the default mechanism using the system properties:

  • actors.minPoolSize
  • actors.maxPoolSize
  • actors.corePoolSize
+5
source

You can try the VisualVM tool (available for free from Sun). Among other things, it can control threads when starting the JVM.

+3
source

Source: https://habr.com/ru/post/1724174/


All Articles