Class: Puppet::Util::Profiler::Aggregate::Metric
- Inherits:
-
Hash
- Object
- Hash
- Puppet::Util::Profiler::Aggregate::Metric
show all
- Defined in:
- lib/puppet/util/profiler/aggregate.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#deep_merge, #deep_merge!, #ko_deep_merge!
#deeper_merge, #deeper_merge!, #ko_deeper_merge!
Constructor Details
#initialize ⇒ Metric
Returns a new instance of Metric.
52
53
54
55
56
|
# File 'lib/puppet/util/profiler/aggregate.rb', line 52
def initialize
super
@count = 0
@time = 0
end
|
Instance Attribute Details
57
58
59
|
# File 'lib/puppet/util/profiler/aggregate.rb', line 57
def count
@count
end
|
57
58
59
|
# File 'lib/puppet/util/profiler/aggregate.rb', line 57
def time
@time
end
|
Instance Method Details
59
60
61
62
63
64
|
# File 'lib/puppet/util/profiler/aggregate.rb', line 59
def [](key)
if !has_key?(key)
self[key] = Metric.new
end
super(key)
end
|
#add_time(time) ⇒ Object
70
71
72
|
# File 'lib/puppet/util/profiler/aggregate.rb', line 70
def add_time(time)
@time += time
end
|
#increment ⇒ Object
66
67
68
|
# File 'lib/puppet/util/profiler/aggregate.rb', line 66
def increment
@count += 1
end
|