Sha256: 758df51cec624dfd9ddc87ae8dffc6a7237195162295e5154d96859a3f9820ad

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 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, **kwargs)
      return if current_reporter
      self.current_reporter = Reporter.new(dir)
      current_reporter.start(**kwargs)
    end

    def stop
      current_reporter&.stop
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heap-profiler-0.7.0 lib/heap_profiler/runtime.rb