Skip to content

Instantly share code, notes, and snippets.

@ferd
Last active June 29, 2018 03:16
Show Gist options
  • Save ferd/6990844 to your computer and use it in GitHub Desktop.
Save ferd/6990844 to your computer and use it in GitHub Desktop.
Monitor long scheduling, long gc, and busy distributed ports
F = fun(F) ->
receive
{monitor, Pid, long_schedule, Info} -> io:format(user, "monitor=long_schedule pid=~p info=~p~n", [Pid, Info]);
{monitor, Pid, busy_dist_port, Port} -> io:format(user, "monitor=busy_dist_port pid=~p port=~p~n" ,[Pid, Port]);
{monitor, Pid, long_gc, Info} -> io:format(user, "monitor=long_gc pid=~p info=~p~n", [Pid, Info])
end,
F(F)
end.
Setup = fun() -> register(temp_sys_monitor, self()), erlang:system_monitor(self(), [{long_schedule, 1000}, busy_dist_port, {long_gc, 1000}]), F(F) end.
recon:rpc(fun() -> spawn(Setup) end).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment