Class: Rack::Insight::Instrumentation::ClassProbe

Inherits:
Probe
  • Object
show all
Defined in:
lib/rack/insight/instrumentation/probe.rb

Instance Method Summary collapse

Methods inherited from Probe

#all_collectors, all_probes, #build_tracing_wrappers, class_list, #clear_collectors, #collectors, const_from_name, #descendants, #descendants_that_define, #fulfill_probe_orders, get_probe_chain, #initialize, #log, #probe, probe_for, probes

Methods included from Logging

logger, verbose, verbosity

Constructor Details

This class inherits a constructor from Rack::Insight::Instrumentation::Probe

Instance Method Details

#define_trace_method(target, method) ⇒ Object



185
186
187
188
189
190
191
192
193
# File 'lib/rack/insight/instrumentation/probe.rb', line 185

def define_trace_method(target, method)
  (class << target; self; end).class_exec() do
    define_method(method.name) do |*args, &block|
      ProbeRunner::probe_run(self, target.name, :class, args, caller(0)[0], method.name) do
        method.bind(self).call(*args, &block)
      end
    end
  end
end

#get_method(klass, method_name) ⇒ Object



181
182
183
# File 'lib/rack/insight/instrumentation/probe.rb', line 181

def get_method(klass, method_name)
  (class << klass; self; end).instance_method(method_name)
end

#local_method_defs(klass) ⇒ Object



177
178
179
# File 'lib/rack/insight/instrumentation/probe.rb', line 177

def local_method_defs(klass)
  klass.singleton_methods(false)
end