Module: XRay::DTrace::Tracer::Leopard

Defined in:
lib/xray/dtrace/tracer/leopard.rb

Overview

Wrapper around OS X DTracer exposing a custom API and namespace.

Instance Method Summary collapse

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/xray/dtrace/tracer/leopard.rb', line 19

def enabled?
  DTracer.enabled?
end

#fire(name, data = nil) ⇒ Object



8
9
10
# File 'lib/xray/dtrace/tracer/leopard.rb', line 8

def fire(name, data = nil)
  DTracer.fire(name, data)
end

#firing(name, data = nil) ⇒ Object



12
13
14
15
16
17
# File 'lib/xray/dtrace/tracer/leopard.rb', line 12

def firing(name, data = nil)
  fire(name + "-start", data)
  result = yield
  fire(name + "-end", data)
  result
end