Class: Benchmark::Memory::Report
- Inherits:
-
Object
- Object
- Benchmark::Memory::Report
- Defined in:
- lib/benchmark/memory/report.rb,
lib/benchmark/memory/report/entry.rb,
lib/benchmark/memory/report/comparator.rb,
lib/benchmark/memory/report/comparison.rb
Overview
Hold the results of a set of benchmarks.
Defined Under Namespace
Classes: Comparator, Comparison, Entry
Instance Attribute Summary collapse
-
#comparator ⇒ Comparator
The Comparator to use when creating the Comparison.
-
#entries ⇒ Array<Entry>
readonly
The entries in the report.
Instance Method Summary collapse
-
#add_entry(task, measurement) ⇒ Entry
Add an entry to the report.
-
#comparable? ⇒ Boolean
Return true if the report is comparable.
-
#comparison ⇒ Comparison
Compare the entries within a report.
-
#initialize ⇒ Report
constructor
Instantiate a report to hold entries of tasks and measurements.
Constructor Details
#initialize ⇒ Report
Instantiate a report to hold entries of tasks and measurements.
13 14 15 16 |
# File 'lib/benchmark/memory/report.rb', line 13 def initialize @entries = [] @comparator = Comparator.new end |
Instance Attribute Details
#comparator ⇒ Comparator
Returns The Comparator to use when creating the Comparison.
19 20 21 |
# File 'lib/benchmark/memory/report.rb', line 19 def comparator @comparator end |
#entries ⇒ Array<Entry> (readonly)
Returns The entries in the report.
22 23 24 |
# File 'lib/benchmark/memory/report.rb', line 22 def entries @entries end |
Instance Method Details
#add_entry(task, measurement) ⇒ Entry
Add an entry to the report.
30 31 32 33 34 |
# File 'lib/benchmark/memory/report.rb', line 30 def add_entry(task, measurement) entry = Entry.new(task.label, measurement) entries.push(entry) entry end |
#comparable? ⇒ Boolean
Return true if the report is comparable.
39 40 41 |
# File 'lib/benchmark/memory/report.rb', line 39 def comparable? comparison.possible? end |
#comparison ⇒ Comparison
Compare the entries within a report.
46 47 48 |
# File 'lib/benchmark/memory/report.rb', line 46 def comparison @comparison ||= Comparison.new(entries, comparator) end |