Class: HeapProfiler::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/heap_profiler/diff.rb

Defined Under Namespace

Classes: DumpSubset

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_directory) ⇒ Diff

Returns a new instance of Diff.



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

def initialize(report_directory)
  @report_directory = report_directory
  @allocated = open_dump('allocated')
  @generation = Integer(File.read(File.join(report_directory, 'generation.info')))
  @generation = nil if @generation == 0
end

Instance Attribute Details

#allocatedObject (readonly)

Returns the value of attribute allocated.



16
17
18
# File 'lib/heap_profiler/diff.rb', line 16

def allocated
  @allocated
end

Instance Method Details

#allocated_diffObject



25
26
27
# File 'lib/heap_profiler/diff.rb', line 25

def allocated_diff
  @allocated_diff ||= DumpSubset.new(@allocated.path, @generation)
end

#retained_diffObject



29
30
31
# File 'lib/heap_profiler/diff.rb', line 29

def retained_diff
  @retained_diff ||= DumpSubset.new(open_dump('retained').path, @generation)
end