Class: Rack::Insight::Instrumentation::ProbeDefinition

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

Instance Method Summary collapse

Constructor Details

#initialize(package, target_name) ⇒ ProbeDefinition

Returns a new instance of ProbeDefinition.



3
4
5
6
# File 'lib/rack/insight/instrumentation/probe-definition.rb', line 3

def initialize(package, target_name)
  @package = package
  @target_name = target_name
end

Instance Method Details

#class_probe(*method_names) ⇒ Object



14
15
16
17
18
# File 'lib/rack/insight/instrumentation/probe-definition.rb', line 14

def class_probe(*method_names)
  if probes = @package.get_class_probe(@target_name)
    probes.probe(@package.collector, *method_names)
  end
end

#instance_probe(*method_names) ⇒ Object



8
9
10
11
12
# File 'lib/rack/insight/instrumentation/probe-definition.rb', line 8

def instance_probe(*method_names)
  if probes = @package.get_instance_probe(@target_name)
    probes.probe(@package.collector, *method_names)
  end
end