Skip to content

Instantly share code, notes, and snippets.

@bforchhammer
Last active May 15, 2019 08:46
Show Gist options
  • Save bforchhammer/2ad5b26f84e85f3708e2e0c9133212cc to your computer and use it in GitHub Desktop.
Save bforchhammer/2ad5b26f84e85f3708e2e0c9133212cc to your computer and use it in GitHub Desktop.
Profiling Elixir Processes
:eprof.start()
process_pids_or_names = [self()]
:eprof.start_profiling(process_pids_or_names)
# do work which causes calls on the traced PIDs
:eprof.stop_profiling()
# output generated
:eprof.log("trace.log")
:eprof.analyze(:total)
:fprof.start()
# process_pids = [Process.whereis(process_name)]
process_pids = [self()]
:fprof.trace([:start, file: 'fprof.trace', procs: process_pids])
# do work which causes calls on the traced PIDs
:fprof.trace(:stop)
:fprof.profile()
:fprof.analyse([dest: 'analysis.txt', cols: 120, callers: true, sort: :own, totals: true, details: true])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment