Module: Busted::Traceable
- Included in:
- Profiler::Default, Profiler::Sandwich
- Defined in:
- lib/busted/traceable.rb
Instance Attribute Summary collapse
-
#report ⇒ Object
writeonly
Sets the attribute report.
-
#trace ⇒ Object
readonly
Returns the value of attribute trace.
-
#tracer ⇒ Object
readonly
Returns the value of attribute tracer.
Instance Method Summary collapse
Instance Attribute Details
#report=(value) ⇒ Object (writeonly)
Sets the attribute report
7 8 9 |
# File 'lib/busted/traceable.rb', line 7 def report=(value) @report = value end |
#trace ⇒ Object (readonly)
Returns the value of attribute trace.
6 7 8 |
# File 'lib/busted/traceable.rb', line 6 def trace @trace end |
#tracer ⇒ Object (readonly)
Returns the value of attribute tracer.
6 7 8 |
# File 'lib/busted/traceable.rb', line 6 def tracer @tracer end |
Instance Method Details
#finish_tracer ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/busted/traceable.rb', line 29 def finish_tracer return unless trace? tracer.finish report[:traces] = tracer.report end |
#start_tracer ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/busted/traceable.rb', line 13 def start_tracer return unless trace? unless Tracer.exists? fail Tracer::MissingCommandError, "tracer requires dtrace" end unless CurrentProcess.privileged? fail Errno::EPERM, "dtrace requires root privileges" end @tracer = Tracer.new tracer.start end |
#trace? ⇒ Boolean
9 10 11 |
# File 'lib/busted/traceable.rb', line 9 def trace? trace end |