Class: Perf::Measure

Inherits:
Object
  • Object
show all
Defined in:
lib/perf/measure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#countObject

Returns the value of attribute count.



6
7
8
# File 'lib/perf/measure.rb', line 6

def count
  @count
end

#measuringObject

Returns the value of attribute measuring.



8
9
10
# File 'lib/perf/measure.rb', line 8

def measuring
  @measuring
end

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/perf/measure.rb', line 5

def path
  @path
end

#timeObject

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

Returns:

  • (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