Module: Benchin

Defined in:
lib/benchin.rb,
lib/benchin/wrap.rb,
lib/benchin/version.rb,
lib/benchin/wrap/report.rb,
lib/benchin/wrap/report/node.rb,
lib/benchin/wrap/report/node_printer.rb

Overview

Benchmarking toolset.

Examples:

Using Wrap global instance

Benchin.wrap.reset
Benchin.wrap.call('Expesive Code') do
  expesive_logic
  10.times do
    Benchin.wrap.call('Nested Hot Operation') { do_something }
  end
end

puts Benchin.wrap

See Also:

Defined Under Namespace

Classes: Error, Wrap

Constant Summary collapse

VERSION =
'0.1.0'.freeze

Class Method Summary collapse

Class Method Details

.wrapWrap

Returns global instance of Wrap.

It can be used to simplify usage when you have to wrap code in many different places in your project.

Returns:

See Also:


30
31
32
# File 'lib/benchin.rb', line 30

def wrap
  @wrap ||= Wrap.new('GLOBAL')
end