Class: Puppet::Util::Profiler::WallClock Private

Inherits:
Logging show all
Defined in:
lib/puppet/util/profiler/wall_clock.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A profiler implementation that measures the number of seconds a segment of code takes to execute and provides a callback with a string representation of the profiling information.

Direct Known Subclasses

Aggregate

Defined Under Namespace

Classes: Timer

Instance Method Summary collapse

Methods inherited from Logging

#finish, #initialize, #shutdown, #start

Constructor Details

This class inherits a constructor from Puppet::Util::Profiler::Logging

Instance Method Details

#do_finish(context, description, metric_id) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
18
# File 'lib/puppet/util/profiler/wall_clock.rb', line 15

def do_finish(context, description, metric_id)
  { :time => context.stop,
    :msg => _("took %{context} seconds") % { context: context } }
end

#do_start(description, metric_id) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/puppet/util/profiler/wall_clock.rb', line 11

def do_start(description, metric_id)
  Timer.new
end