Method: Puppet::Rails::Benchmark#accumulate_benchmark
- Defined in:
- lib/vendor/puppet/rails/benchmark.rb
#accumulate_benchmark(message, label) ⇒ Object
Collect partial benchmarks to be logged when they’re all done.
These are always low-level debugging so we only
print them if time_debug is enabled.
30 31 32 33 34 35 |
# File 'lib/vendor/puppet/rails/benchmark.rb', line 30 def accumulate_benchmark(, label) return yield unless time_debug? $benchmarks[:accumulated][] ||= Hash.new(0) $benchmarks[:accumulated][][label] += Benchmark.realtime { yield } end |