Class: Benchmark::Memory::Report::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/benchmark/memory/report/entry.rb

Overview

An entry in a report about a benchmark.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label, measurement) ⇒ Entry

Instantiate a new entry.

Parameters:

  • label (#to_s)

    The entry label.

  • measurement (Measurement)

    The measurements for the entry.



12
13
14
15
# File 'lib/benchmark/memory/report/entry.rb', line 12

def initialize(label, measurement)
  @label = label
  @measurement = measurement
end

Instance Attribute Details

#label#to_s (readonly)

Returns The entry label.

Returns:

  • (#to_s)

    The entry label.



18
19
20
# File 'lib/benchmark/memory/report/entry.rb', line 18

def label
  @label
end

#measurementMeasurement (readonly)

Returns The measurements for the entry.

Returns:



21
22
23
# File 'lib/benchmark/memory/report/entry.rb', line 21

def measurement
  @measurement
end

Instance Method Details

#allocated_memoryInteger

Get the total amount of memory allocated in the entry.

Returns:

  • (Integer)


26
27
28
# File 'lib/benchmark/memory/report/entry.rb', line 26

def allocated_memory
  measurement.memory.allocated
end