As a visual learner, I’m always in search of ways to graphically represent my programs. Erlang (and Elixir) has a GUI process viewer called Observer, that displays a graphical tree of your program’s process hierarchy. The only issue is it’s not included out of the box with most Elixir installs. Some googling yielded some really complex processes to get it set up, but I found with the current version of Erlang (19.0) and Mac OS (El Capitan) are actually pretty straightforward.
First, install wxWidgets via Homebrew.
$ brew install wxmac
Then, make sure that your Erlang compile options include the
I use asdf to manage my Erlang install, so I needed to add the flag to this environment variable prior to installing Erlang.
ERLANG_CONFIGURE_OPTIONS="--enable-darwin-64bit --with-ssl=/usr/local/opt/openssl --with-wx"
If you use kerl, you would add the option to this variable:
Once you have Erlang compiled, you’re good to go - this feature bubbles right up te Elixir! You can fire up observer right from IEx:
iex> :observer.start :ok
Which will open up an amazing tool to explore you running application!