Replbug (replbug v0.1.4)
Utility for pulling the function call traces into your IEx shell for further analysis and experimentation. The code is built on top of Rexbug (https://github.com/nietaki/rexbug). Motivation: Rexbug provides a convenient way of tracing function calls by printing the trace messages to IEx shell and/or the external file. In addition, Replbug allows to materialize traces as a variable, and then analyze the call data in IEx for debugging, experimentation, collecting stats etc.
Link to this section Summary
Functions
Group the trace by function calls (MFA).
Repeat the call with the same arguments, for instance, after you've applied the changes to the code and reloaded the module. Use replay/1 with caution in prod! Also, it may not work as expected due to changes happened in between the initial call and the time of replay.
Stop the collection and get the traces as a map of pid => trace_records
Link to this section Functions
calls(trace)
Group the trace by function calls (MFA).
get_caller_pids(trace)
replay(call_record)
@spec replay(%{ :args => list(), :function => atom(), :module => atom() | tuple(), optional(any()) => any() }) :: any()
Repeat the call with the same arguments, for instance, after you've applied the changes to the code and reloaded the module. Use replay/1 with caution in prod! Also, it may not work as expected due to changes happened in between the initial call and the time of replay.
start(call_pattern, opts \\ [])
@spec start( :receive | :send | binary() | maybe_improper_list(), keyword() ) :: :ignore | {:error, any()} | {:ok, pid()}
stop()
Stop the collection and get the traces as a map of pid => trace_records