diff options
Diffstat (limited to 'lib/puppet/util/profiler/logging.rb')
-rw-r--r-- | lib/puppet/util/profiler/logging.rb | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/puppet/util/profiler/logging.rb b/lib/puppet/util/profiler/logging.rb index c0de09e25..5d1fd101c 100644 --- a/lib/puppet/util/profiler/logging.rb +++ b/lib/puppet/util/profiler/logging.rb @@ -5,19 +5,20 @@ class Puppet::Util::Profiler::Logging @sequence = Sequence.new end - def profile(description, &block) - retval = nil + def start(description, metric_id) @sequence.next @sequence.down - context = start - begin - retval = yield - ensure - profile_explanation = finish(context) - @sequence.up - @logger.call("PROFILE [#{@identifier}] #{@sequence} #{description}: #{profile_explanation}") - end - retval + do_start(description, metric_id) + end + + def finish(context, description, metric_id) + profile_explanation = do_finish(context, description, metric_id)[:msg] + @sequence.up + @logger.call("PROFILE [#{@identifier}] #{@sequence} #{description}: #{profile_explanation}") + end + + def shutdown() + # nothing to do end class Sequence |