Class: ProfilerDB
Instance Attribute Summary collapse
-
#add_c_calls ⇒ Object
Returns the value of attribute add_c_calls.
-
#cpu_end ⇒ Object
Returns the value of attribute cpu_end.
-
#cpu_st ⇒ Object
Returns the value of attribute cpu_st.
-
#file ⇒ Object
Returns the value of attribute file.
-
#links ⇒ Object
Returns the value of attribute links.
-
#load_wall_end ⇒ Object
Returns the value of attribute load_wall_end.
-
#load_wall_st ⇒ Object
Returns the value of attribute load_wall_st.
-
#nodes ⇒ Object
Returns the value of attribute nodes.
-
#outdev ⇒ Object
Returns the value of attribute outdev.
-
#outfl ⇒ Object
Returns the value of attribute outfl.
-
#prof_wall_end ⇒ Object
Returns the value of attribute prof_wall_end.
-
#prof_wall_st ⇒ Object
Returns the value of attribute prof_wall_st.
Instance Method Summary collapse
-
#initialize ⇒ ProfilerDB
constructor
A new instance of ProfilerDB.
- #start ⇒ Object
- #stop(ld_st, ld_end, pf_end) ⇒ Object
Methods included from TimeHelpers
Constructor Details
#initialize ⇒ ProfilerDB
Returns a new instance of ProfilerDB.
171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/shoes/profiler.rb', line 171 def initialize nodes = {} links = {} file = '' load_wall_st = 0 load_wall_end = 0 prof_wall_st = 0 prof_wall_end = 0 cpu_st = 0 cpu_end = 0 outdev = $stderr outfl = 0 end |
Instance Attribute Details
#add_c_calls ⇒ Object
Returns the value of attribute add_c_calls.
168 169 170 |
# File 'lib/shoes/profiler.rb', line 168 def add_c_calls @add_c_calls end |
#cpu_end ⇒ Object
Returns the value of attribute cpu_end.
170 171 172 |
# File 'lib/shoes/profiler.rb', line 170 def cpu_end @cpu_end end |
#cpu_st ⇒ Object
Returns the value of attribute cpu_st.
170 171 172 |
# File 'lib/shoes/profiler.rb', line 170 def cpu_st @cpu_st end |
#file ⇒ Object
Returns the value of attribute file.
168 169 170 |
# File 'lib/shoes/profiler.rb', line 168 def file @file end |
#links ⇒ Object
Returns the value of attribute links.
168 169 170 |
# File 'lib/shoes/profiler.rb', line 168 def links @links end |
#load_wall_end ⇒ Object
Returns the value of attribute load_wall_end.
169 170 171 |
# File 'lib/shoes/profiler.rb', line 169 def load_wall_end @load_wall_end end |
#load_wall_st ⇒ Object
Returns the value of attribute load_wall_st.
169 170 171 |
# File 'lib/shoes/profiler.rb', line 169 def load_wall_st @load_wall_st end |
#nodes ⇒ Object
Returns the value of attribute nodes.
168 169 170 |
# File 'lib/shoes/profiler.rb', line 168 def nodes @nodes end |
#outdev ⇒ Object
Returns the value of attribute outdev.
170 171 172 |
# File 'lib/shoes/profiler.rb', line 170 def outdev @outdev end |
#outfl ⇒ Object
Returns the value of attribute outfl.
170 171 172 |
# File 'lib/shoes/profiler.rb', line 170 def outfl @outfl end |
#prof_wall_end ⇒ Object
Returns the value of attribute prof_wall_end.
169 170 171 |
# File 'lib/shoes/profiler.rb', line 169 def prof_wall_end @prof_wall_end end |
#prof_wall_st ⇒ Object
Returns the value of attribute prof_wall_st.
169 170 171 |
# File 'lib/shoes/profiler.rb', line 169 def prof_wall_st @prof_wall_st end |
Instance Method Details
#start ⇒ Object
185 186 187 188 189 190 191 |
# File 'lib/shoes/profiler.rb', line 185 def start @tracer = nil if @tracer @tracer = Tracer.new(Reporter.new, add_c_calls) @cpu_st = cpu_time @tracer.enable yield end |
#stop(ld_st, ld_end, pf_end) ⇒ Object
193 194 195 196 197 198 199 200 201 |
# File 'lib/shoes/profiler.rb', line 193 def stop(ld_st, ld_end, pf_end) @cpu_end = cpu_time @tracer.disable @load_wall_st = ld_st @load_wall_end = ld_end @prof_wall_st = ld_end @prof_wall_end = pf_end @tracer.result end |