class BenchmarkDriver::Runner::Memory
def run(jobs)
-
jobs
(Array
) --
def run(jobs) # Currently Linux's time(1) support only... case Etc.uname.fetch(:sysname) when 'Linux' @time_command = ['/usr/bin/time'] when 'Darwin' @time_command = ['/usr/bin/time', '-l'] else raise "memory output is not supported for '#{Etc.uname[:sysname]}' for now" end if jobs.any? { |job| job.loop_count.nil? } jobs = jobs.map do |job| job.loop_count ? job : Job.new(**job.to_h.merge(loop_count: 1)) end end @output.with_benchmark do jobs.each do |job| @output.with_job(name: job.name) do job.runnable_contexts(@contexts).each do |context| result = BenchmarkDriver::Repeater.with_repeat(config: @config, larger_better: false) do run_benchmark(job, context: context) end @output.with_context(name: context.name, executable: context.executable, gems: context.gems, prelude: context.prelude) do @output.report(values: { METRIC => result.value }, all_values: { METRIC => result.all_values }, loop_count: job.loop_count) end end end end end end