Class: ProfProcessor

Inherits:
ProfiledProcessor show all
Defined in:
lib/action_profiler/prof_processor.rb

Overview

A ProfiledProcessor that uses Shugo Maeda’s Prof profiler.

The Prof profiler requires Ruby 1.8.3 or better and can be found at shugo.net/archive/ruby-prof/

The Prof profiler is configured to use gettimeofday(2). There is no way to change this setting.

Constant Summary

Constants inherited from ProfiledProcessor

ProfiledProcessor::PROFILERS

Instance Method Summary collapse

Methods inherited from ProfiledProcessor

load_default_processor, load_processor, process_args, #profile

Methods inherited from TestProcessor

#process

Constructor Details

#initialize(*args) ⇒ ProfProcessor

:nodoc:



17
18
19
20
# File 'lib/action_profiler/prof_processor.rb', line 17

def initialize(*args) # :nodoc:
  super
  @profile_data = nil
end

Instance Method Details

:nodoc:



33
34
35
36
# File 'lib/action_profiler/prof_processor.rb', line 33

def print_profile(io = STDERR) # :nodoc:
  return unless @profile_data
  Prof.print_profile @profile_data, io
end

#start_profileObject

:nodoc:



22
23
24
# File 'lib/action_profiler/prof_processor.rb', line 22

def start_profile # :nodoc:
  Prof.start
end

#stop_profileObject

Prof returns profile data on Prof.stop, so save it for printing.



29
30
31
# File 'lib/action_profiler/prof_processor.rb', line 29

def stop_profile # :nodoc:
  @profile_data = Prof.stop
end