Class: WTT::Core::Tracer
- Inherits:
-
Object
- Object
- WTT::Core::Tracer
- Defined in:
- lib/wtt/core/tracer.rb
Overview
Helper class to gather coverage data via the Tracepoint API
Instance Method Summary collapse
- #coverage ⇒ Object
-
#initialize ⇒ Tracer
constructor
A new instance of Tracer.
- #start_trace ⇒ Object
- #stop_trace ⇒ Object
Constructor Details
#initialize ⇒ Tracer
Returns a new instance of Tracer.
10 11 12 13 14 |
# File 'lib/wtt/core/tracer.rb', line 10 def initialize @remotes = [] reset_coverage connect_remotes WTT.configuration.remotes end |
Instance Method Details
#coverage ⇒ Object
28 29 30 31 32 |
# File 'lib/wtt/core/tracer.rb', line 28 def coverage all_coverage = @coverage.dup @remotes.each { |r| merge_remote_coverage!(all_coverage, r.coverage) } all_coverage end |
#start_trace ⇒ Object
16 17 18 19 20 21 |
# File 'lib/wtt/core/tracer.rb', line 16 def start_trace @debug = [] reset_coverage start_remotes tracepoint.enable end |
#stop_trace ⇒ Object
23 24 25 26 |
# File 'lib/wtt/core/tracer.rb', line 23 def stop_trace stop_remotes tracepoint.disable end |