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/comparison.rb
Overview
Hold the results of a set of benchmarks.
Defined Under Namespace
Classes: Comparison, Entry
Instance Attribute Summary collapse
-
#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.
11 12 13 |
# File 'lib/benchmark/memory/report.rb', line 11 def initialize @entries = [] end |
Instance Attribute Details
#entries ⇒ Array<Entry> (readonly)
Returns The entries in the report.
16 17 18 |
# File 'lib/benchmark/memory/report.rb', line 16 def entries @entries end |
Instance Method Details
#add_entry(task, measurement) ⇒ Entry
Add an entry to the report.
24 25 26 27 28 |
# File 'lib/benchmark/memory/report.rb', line 24 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.
33 34 35 |
# File 'lib/benchmark/memory/report.rb', line 33 def comparable? comparison.possible? end |
#comparison ⇒ Comparison
Compare the entries within a report.
40 41 42 |
# File 'lib/benchmark/memory/report.rb', line 40 def comparison @comparison ||= Comparison.new(entries) end |