Class: Insight::Instrumentation::ClassProbe

Inherits:
Probe
  • Object
show all
Defined in:
lib/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

Constructor Details

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

Instance Method Details

#define_trace_method(target, method) ⇒ Object



182
183
184
185
186
187
188
189
190
# File 'lib/insight/instrumentation/probe.rb', line 182

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



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

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

#local_method_defs(klass) ⇒ Object



174
175
176
# File 'lib/insight/instrumentation/probe.rb', line 174

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