module TingYun::Instrumentation::Support::MethodInstrumentation

Public Class Methods

extended(klass) click to toggle source
# File lib/ting_yun/instrumentation/support/method_instrumentation.rb, line 50
def self.extended(klass)
  klass.extend ClassMethods
end
included(klass) click to toggle source

This module contains class methods added to support installing custom metric tracers and executing for individual metrics.

Examples

When the agent initializes, it extends Module with these methods. However if you want to use the API in code that might get loaded before the agent is initialized you will need to require this file:

require 'ting_yun/instrumentation/support/method_instrumentation'
class A
  include TingYun::Instrumentation::Support::MethodInstrumentation
  def process
    ...
  end
  add_method_tracer :process
end

To instrument a class method:

 require 'ting_yun/instrumentation/support/method_instrumentation'
class An
  def self.process
    ...
  end
  class << self
    include TingYun::Instrumentation::Support::MethodInstrumentation
    add_method_tracer :process
  end
end

@api public

# File lib/ting_yun/instrumentation/support/method_instrumentation.rb, line 46
def self.included(klass)
  klass.extend ClassMethods
end