Module: StackProf::Remote::ReportSaver
- Defined in:
- lib/stackprof/remote/middleware.rb
Class Method Summary collapse
Class Method Details
.marshaled_results ⇒ Object
71 72 73 74 75 |
# File 'lib/stackprof/remote/middleware.rb', line 71 def self.marshaled_results if results = StackProf.results Marshal.dump(results) end end |
.save(base_path) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/stackprof/remote/middleware.rb', line 77 def self.save(base_path) if results = marshaled_results FileUtils.mkdir_p(base_path) filename = "stackprof-#{Process.pid}-#{Time.now.to_i}.dump" path = File.join(base_path, filename) File.open(path, 'wb') do |f| f.write results end File.readable?(path) ? path : nil end end |