Class: Perf::Measure
- Inherits:
-
Object
- Object
- Perf::Measure
- Defined in:
- lib/perf/measure.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#measuring ⇒ Object
Returns the value of attribute measuring.
-
#path ⇒ Object
Returns the value of attribute path.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(measure_path) ⇒ Measure
constructor
A new instance of Measure.
- #measuring? ⇒ Boolean
- #merge(m) ⇒ Object
Constructor Details
#initialize(measure_path) ⇒ Measure
Returns a new instance of Measure.
10 11 12 13 14 15 |
# File 'lib/perf/measure.rb', line 10 def initialize(measure_path) @path = measure_path @count = 0 @time = Benchmark::Tms.new @measuring = 0 end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
6 7 8 |
# File 'lib/perf/measure.rb', line 6 def count @count end |
#measuring ⇒ Object
Returns the value of attribute measuring.
8 9 10 |
# File 'lib/perf/measure.rb', line 8 def measuring @measuring end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/perf/measure.rb', line 5 def path @path end |
#time ⇒ Object
Returns the value of attribute time.
7 8 9 |
# File 'lib/perf/measure.rb', line 7 def time @time end |
Instance Method Details
#measuring? ⇒ Boolean
17 18 19 |
# File 'lib/perf/measure.rb', line 17 def measuring? @measuring>0 end |
#merge(m) ⇒ Object
21 22 23 24 25 |
# File 'lib/perf/measure.rb', line 21 def merge(m) @count += m.count @time += m.time @measuring += m.measuring end |