Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arcusfelis/2fc38093e26a70c4b43c729385c635ef to your computer and use it in GitHub Desktop.
Save arcusfelis/2fc38093e26a70c4b43c729385c635ef to your computer and use it in GitHub Desktop.
debug erlang message queues in mongooseim
rp(lists:reverse([{Len, case erlang:process_info(TopPid, registered_name) of {_,X} -> X; _ -> TopPid end, erlang:process_info(TopPid, current_stacktrace)} || {Len, TopPid} <- lists:sublist(lists:reverse(lists:keysort(1, [{try element(2,erlang:process_info(Pid, message_queue_len)) + proplists:get_value('$internal_queue_len', element(2, erlang:process_info(Pid, dictionary)), 0) catch _:_ -> -1 end, Pid} || Pid <- erlang:processes()])), 20)])).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment