Module: RuntimeProfiler

Includes:
ActiveSupport::Configurable
Defined in:
lib/runtime_profiler.rb,
lib/runtime_profiler/cli.rb,
lib/runtime_profiler/data.rb,
lib/runtime_profiler/version.rb,
lib/runtime_profiler/profiler.rb,
lib/runtime_profiler/text_report.rb,
lib/runtime_profiler/events/sql_event.rb,
lib/runtime_profiler/callbacks/active_record.rb,
lib/runtime_profiler/callbacks/action_controller.rb,
lib/runtime_profiler/events/process_action_event.rb

Defined Under Namespace

Modules: Callback Classes: CLI, Data, ProcessActionEvent, Profiler, SqlEvent, TextReport

Constant Summary collapse

VERSION =
'0.4.4'.freeze

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



33
34
35
36
37
38
39
40
# File 'lib/runtime_profiler.rb', line 33

def configure
  begin
    Rails.application.eager_load!
  rescue StandardError
    nil
  end
  yield self if block_given?
end

.profile!(key, constants) ⇒ Object



42
43
44
45
46
# File 'lib/runtime_profiler.rb', line 42

def profile!(key, constants)
  constants = constants.is_a?(Array) ? constants : [constants]
  profiler = Profiler.new(constants)
  profiler.profile!(key) { yield }
end