Class: StackifyRubyAPM::Spies::TiltSpy Private

Inherits:
Object
  • Object
show all
Defined in:
lib/stackify_apm/spies/tilt.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

TYPE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'template.tilt'.freeze

Instance Method Summary collapse

Instance Method Details

#installObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/stackify_apm/spies/tilt.rb', line 14

def install
  ::Tilt::Template.class_eval do
    alias_method 'render_without_apm', 'render'

    def render(*args, &block)
      name = options[:__stackify_apm_template_name] || 'Unknown template'

      # Creates new span for Tilt templating
      #
      StackifyRubyAPM.span name, TYPE do
        render_without_apm(*args, &block)
      end
    end
  end
end