cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

Feature Request: Implement a Debugging and Profiling Tool Similar to Tokio-Console

Open davisuga opened this issue 1 year ago • 4 comments

I am writing to propose the implementation of a feature similar to the tokio-console used in asynchronous Rust applications. This tool has proven to be extremely useful for collecting and displaying in-depth diagnostic data on asynchronous tasks, resources, and operations in an application.

task list view

Viewing details for a single task:

task details view

In Cats-Effect, we already have the ability to remotely trigger fiber snapshots (see LiveFiberSnapshotTriggerMBean.scala) and expose some coarse metrics in various MBeans (see ComputePoolSamplerMBean.scala). These can be accessed by tools, but a more integrated and user-friendly tool like tokio-console would be a great addition to the ecosystem.

I believe that the implementation of a similar tool for Cats-Effect would greatly enhance the debugging and profiling experience for developers. I look forward to hearing your thoughts on this proposal.

davisuga avatar Jul 05 '23 14:07 davisuga

While I was trying to nerdsnipe @mpilquist into doing this, following links were thrown around:

  1. Basic intro JMX: I'm just going to keep adding - here's an example of starting the mbean server: https://www.baeldung.com/java-management-extensions
  2. cjmx - command line JMX tool: https://github.com/cjmx/cjmx
  3. tui-scala - to implement the rich TUI: https://github.com/oyvindberg/tui-scala

keynmol avatar Jul 05 '23 14:07 keynmol

I’m interested in working on something like this. I will create a repo so we can collect ideas, etc.

mpilquist avatar Jul 05 '23 14:07 mpilquist

https://github.com/typelevel/cats-effect-shell

mpilquist avatar Jul 07 '23 11:07 mpilquist

This is cool af. I knew about Tokio shell but had mentally written it off as something we probably wouldn't be able to do. JMX probably gives us an avenue though.

djspiewak avatar Jul 09 '23 16:07 djspiewak