Sha256: 2facc41da3c0bda110fc54fb30808700bee6429d7045e4f2600b3e706c195e67

Contents?: true

Size: 552 Bytes

Versions: 3

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

require "objspace"
require "fileutils"

require "heap_profiler/version"
require "heap_profiler/reporter"

module HeapProfiler
  Error = Class.new(StandardError)
  CapacityError = Class.new(Error)

  class << self
    attr_accessor :current_reporter

    def start(dir)
      return if current_reporter
      self.current_reporter = Reporter.new(dir)
      current_reporter.start
    end

    def stop
      current_reporter&.stop
    end

    def report(dir, &block)
      Reporter.new(dir).run(&block)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
heap-profiler-0.6.0 lib/heap_profiler/runtime.rb
heap-profiler-0.5.0 lib/heap_profiler/runtime.rb
heap-profiler-0.4.0 lib/heap_profiler/runtime.rb