Class: Performance::Report
- Inherits:
-
Object
- Object
- Performance::Report
- Defined in:
- lib/tasks/performance_report.rb
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(run_time: DEFAULT_RUN_TIME, warmup: DEFAULT_WARMUP, items: DEFAULT_ITEMS) ⇒ Report
constructor
A new instance of Report.
- #run_all ⇒ Object
Constructor Details
#initialize(run_time: DEFAULT_RUN_TIME, warmup: DEFAULT_WARMUP, items: DEFAULT_ITEMS) ⇒ Report
Returns a new instance of Report.
178 179 180 181 182 183 184 |
# File 'lib/tasks/performance_report.rb', line 178 def initialize(run_time: DEFAULT_RUN_TIME, warmup: DEFAULT_WARMUP, items: DEFAULT_ITEMS) @run_time = run_time @warmup = warmup @items = items @results = {} end |
Instance Method Details
#as_json ⇒ Object
196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/tasks/performance_report.rb', line 196 def as_json { report_id: REPORT_ID, ruby_version: RUBY_VERSION, platform: RUBY_PLATFORM, run_time: @run_time, warmup: @warmup, items: @items, sax_available: SAX_AVAILABLE, benchmarks: @results, } end |
#run_all ⇒ Object
186 187 188 189 190 191 192 193 194 |
# File 'lib/tasks/performance_report.rb', line 186 def run_all BENCHMARKS.each do |method, | next if method.to_s.start_with?("xml_parse_sax") && !SAX_AVAILABLE label = "#{[:category]}: #{[:name]}" @results[label] = run_benchmark(method) end @results end |