Class: BrainzLab::Instrumentation::ActionView

Inherits:
Object
  • Object
show all
Defined in:
lib/brainzlab/instrumentation/action_view.rb

Constant Summary collapse

SLOW_RENDER_THRESHOLD =

Thresholds for slow render detection (in milliseconds)

50
VERY_SLOW_RENDER_THRESHOLD =
200
COLLECTION_TRACKING_THRESHOLD =

Only track partials rendered more than this many times

10

Class Method Summary collapse

Class Method Details

.install!Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/brainzlab/instrumentation/action_view.rb', line 14

def install!
  return unless defined?(::ActionView)
  return if @installed

  install_render_template_subscriber!
  install_render_partial_subscriber!
  install_render_collection_subscriber!
  install_render_layout_subscriber!

  @installed = true
  BrainzLab.debug_log('ActionView instrumentation installed')
end

.installed?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/brainzlab/instrumentation/action_view.rb', line 27

def installed?
  @installed == true
end