class Timeasure::Configuration

Attributes

enable_timeasure_proc[RW]
post_measuring_proc[RW]
reported_methods_handler_get_proc[RW]
reported_methods_handler_set_proc[RW]
rescue_proc[RW]

Public Class Methods

new() click to toggle source
# File lib/timeasure/configuration.rb, line 6
def initialize
  @post_measuring_proc = lambda do |measurement|
    # Enables the configuration of what to do with each method runtime measurement.
    # By default it reports to Timeasure's Profiling Manager.

    Timeasure::Profiling::Manager.report(measurement)
  end

  @rescue_proc = lambda do |e, klass|
    # Enabled the configuration of post_measuring_proc rescue.
  end

  @enable_timeasure_proc = lambda do
    # Enables toggling Timeasure's activation (e.g. for disabling Timeasure for RSpec).

    true
  end

  @reported_methods_handler_set_proc = lambda do |reported_methods_handler|
    # Enables configuring where to store the ReportedMethodsHandler instance.
    # This proc will be called by Timeasure::Profiling::Manager.prepare.
    # By default it stores the handler as a class instance variable (in Timeasure::Profiling::Manager)

    @reported_methods_handler = reported_methods_handler
  end

  @reported_methods_handler_get_proc = lambda do
    # Enables configuring where to fetch the ReportedMethodsHandler instance.
    # This proc will be called by Timeasure::Profiling::Manager.report and Timeasure::Profiling::Manager.export.
    # By default it fetches the handler from the class instance variable
    # (see @reported_methods_handler_set_proc).

    @reported_methods_handler
  end
end