Module: MemoryProfiler

Defined in:
lib/memory_profiler.rb,
lib/memory_profiler/cli.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: CLI, Helpers, Monochrome, Polychrome, Reporter, Results, Stat, StatHash

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

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



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

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

.start(opts = {}) ⇒ Object



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

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

.stopObject



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

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