Module: DeepCover::Tools::Profiling
- Defined in:
- lib/deep_cover/tools/profiling.rb
Defined Under Namespace
Classes: RubyProfProfiler
Instance Method Summary
collapse
Instance Method Details
#dont_profile ⇒ Object
35
36
37
38
39
40
|
# File 'lib/deep_cover/tools/profiling.rb', line 35
def dont_profile
pause if profiler_loaded?
yield
ensure
resume if profiler_loaded?
end
|
#pause ⇒ Object
14
15
16
|
# File 'lib/deep_cover/tools/profiling.rb', line 14
def pause
profiler.pause
end
|
#profile(do_start = true) ⇒ Object
Basic utilities using forwarding methods
27
28
29
30
31
32
33
|
# File 'lib/deep_cover/tools/profiling.rb', line 27
def profile(do_start = true)
return yield unless do_start
start
yield
stop
report
end
|
#profiler_loaded? ⇒ Boolean
42
43
44
|
# File 'lib/deep_cover/tools/profiling.rb', line 42
def profiler_loaded?
!!@profiler
end
|
#report ⇒ Object
22
23
24
|
# File 'lib/deep_cover/tools/profiling.rb', line 22
def report
profiler.report(@results)
end
|
#resume ⇒ Object
18
19
20
|
# File 'lib/deep_cover/tools/profiling.rb', line 18
def resume
profiler.resume
end
|
#start ⇒ Object
Simple forwarding to implementation
6
7
8
|
# File 'lib/deep_cover/tools/profiling.rb', line 6
def start
profiler.start
end
|
#stop ⇒ Object
10
11
12
|
# File 'lib/deep_cover/tools/profiling.rb', line 10
def stop
@results = profiler.stop
end
|