Skip to content

Commit

Permalink
Merge pull request #11 from srufle/master
Browse files Browse the repository at this point in the history
Changed to use randomized file name
  • Loading branch information
parroty authored Apr 15, 2018
2 parents d0c97ef + bde6819 commit 65b9f18
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/exprof.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ defmodule ExProf do
It also outputs to the STDOUT.
"""
def analyze do
:eprof.log(@tmp_prof_name)
random_number = :rand.uniform(100)
file_name = to_string(@tmp_prof_name ++ [to_string(random_number)])
:eprof.log(file_name)
:eprof.analyze(:total, [{:sort, :time}])
records = ExProf.Reader.read(@tmp_prof_name)
File.rm!(@tmp_prof_name)
records = ExProf.Reader.read(file_name)
File.rm!(file_name)
records
end
end

0 comments on commit 65b9f18

Please sign in to comment.