Last active
May 15, 2019 08:46
-
-
Save bforchhammer/2ad5b26f84e85f3708e2e0c9133212cc to your computer and use it in GitHub Desktop.
Profiling Elixir Processes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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