Hacker News new | ask | show | jobs
by skndr 735 days ago
The cool thing is that you can, with the BEAM, connect your shell[0] to a running server and use something like recon_trace[1] to watch functions as they’re getting called. The same principle is used for libraries like this distributed profiler so you can watch the aggregate performance of your application[2].

[0] https://hexdocs.pm/iex/1.12/IEx.html#module-remote-shells (the remsh flag)

[1] https://ferd.github.io/recon/recon_trace.html

[2] https://hexdocs.pm/orion/Orion.html

2 comments

Not just a running server, you can hook into a running cluster and do such things.

The Observer, :observer.start(), is another very nice tool. Might require some widget libraries for the GUI but you'll likely have set that up on the machine you're doing the introspection from.

This was possible with various flavors of Pry and DRB once upon a time.