Class: Benchmark::Memory::Report::Entry
- Inherits:
-
Object
- Object
- Benchmark::Memory::Report::Entry
- Defined in:
- lib/benchmark/memory/report/entry.rb
Overview
An entry in a report about a benchmark.
Instance Attribute Summary collapse
-
#label ⇒ #to_s
readonly
The entry label.
-
#measurement ⇒ Measurement
readonly
The measurements for the entry.
Instance Method Summary collapse
-
#compared_metric(comparison) ⇒ Integer
Get the total amount of memory allocated in the entry.
-
#initialize(label, measurement) ⇒ Entry
constructor
Instantiate a new entry.
Constructor Details
#initialize(label, measurement) ⇒ Entry
Instantiate a new entry.
14 15 16 17 |
# File 'lib/benchmark/memory/report/entry.rb', line 14 def initialize(label, measurement) @label = label @measurement = measurement end |
Instance Attribute Details
#label ⇒ #to_s (readonly)
Returns The entry label.
20 21 22 |
# File 'lib/benchmark/memory/report/entry.rb', line 20 def label @label end |
#measurement ⇒ Measurement (readonly)
Returns The measurements for the entry.
23 24 25 |
# File 'lib/benchmark/memory/report/entry.rb', line 23 def measurement @measurement end |
Instance Method Details
#compared_metric(comparison) ⇒ Integer
Get the total amount of memory allocated in the entry.
29 30 31 |
# File 'lib/benchmark/memory/report/entry.rb', line 29 def compared_metric(comparison) measurement.public_send(comparison.metric).public_send(comparison.value) end |