| Module | XRay::DTrace::Tracer |
| In: |
lib/xray/dtrace/tracer/joyent.rb
lib/xray/dtrace/tracer/leopard.rb lib/xray/dtrace/tracer.rb |
Ruby module to fire application-level Dtrace events (using ruby-probe).
This module provide a convenient and unified API abstracting different tracing implementations in Leopard Ruby VM (by Apple) and in the one provided by Joyent (dev.joyent.com/projects/ruby-dtrace). This module also provides a NOOP implementation for Ruby VMs with no DTrace support: So you can use the exact same code while developing on Linux and deploying on Solaris for instance.
Returns true if ruby-probe probes are enabled. (application-level probes for Ruby).
# File lib/xray/dtrace/tracer.rb, line 66
66: def enabled?
67: false
68: end
Fire an application-level probe using ruby-probe.
The first argument passed will be passed to the D script as arg0 for the ruby-probe probe. This is conventionally a probe name.
The second argument is optional and can be used to pass additional data into the D script as arg1.
Example:
XRay::DTrace::Tracer.fire(‘service-start’, "order processing")
XRay::DTrace::Tracer.fire(‘service-stop’)
# File lib/xray/dtrace/tracer.rb, line 31
31: def fire(name, data = nil)
32: end
Use ruby-probe to fire 2 application-level probes before and after evaling a block .
The first argument passed will be passed to the D script as arg0 for the ruby-probe probe. The first argument is conventionally a probe base name. The probes which fire before and after the block runs will have "-start" and "-end" appended to the probe base name, respectively.
The second argument is optional and can be used to pass additional data into the D script as arg1.
Example:
XRay::DTrace::Tracer.firing(‘db-query’, "select * from dual;") do
ActiveRecord::Base.execute("select * from dual;")
end
Will:
# File lib/xray/dtrace/tracer.rb, line 60
60: def firing(name, data = nil)
61: yield
62: end