Module: MemoryProfiler

Defined in:
lib/memory_profiler.rb,
lib/memory_profiler/stat.rb,
lib/memory_profiler/top_n.rb,
lib/memory_profiler/helpers.rb,
lib/memory_profiler/results.rb,
lib/memory_profiler/version.rb,
lib/memory_profiler/reporter.rb,
lib/memory_profiler/stat_hash.rb,
lib/memory_profiler/monochrome.rb,
lib/memory_profiler/polychrome.rb

Defined Under Namespace

Modules: TopN Classes: Helpers, Monochrome, Polychrome, Reporter, Results, Stat, StatHash

Constant Summary collapse

VERSION =
"0.9.14"

Class Method Summary collapse

Class Method Details

.report(opts = {}, &block) ⇒ Object


14
15
16
# File 'lib/memory_profiler.rb', line 14

def self.report(opts = {}, &block)
  Reporter.report(opts, &block)
end

.start(opts = {}) ⇒ Object


18
19
20
21
22
23
# File 'lib/memory_profiler.rb', line 18

def self.start(opts = {})
  unless Reporter.current_reporter
    Reporter.current_reporter = Reporter.new(opts)
    Reporter.current_reporter.start
  end
end

.stopObject


25
26
27
28
29
# File 'lib/memory_profiler.rb', line 25

def self.stop
  Reporter.current_reporter.stop if Reporter.current_reporter
ensure
  Reporter.current_reporter = nil
end