Sha256: 7c4a377c8ab914e34d02091f8ae1375b25f70084eac1fe6deaf73fd224fae287

Contents?: true

Size: 697 Bytes

Versions: 21

Compression:

Stored size: 697 Bytes

Contents

# @param [Benchmark::Driver::Configuration::Job] job
# @param [Integer] iterations - Executed iterations of benchmark script in the job
# @param [Float] real - Real time taken by the job
# @param [Integer] max_rss - Maximum resident set size of the process during its lifetime, in Kilobytes.
class Benchmark::Driver::BenchmarkResult < Struct.new(:job, :iterations, :real, :max_rss)
  alias :duration :real

  def ips
    iterations / real
  end

  def ip100ms
    ips / 10
  end

  def iterations
    # runner's warmup uses `result.ips` to calculate `job.loop_count`, and thus
    # at that moment `job.loop_count` isn't available and we need to use `super`.
    super || job.loop_count
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
benchmark_driver-0.4.0 lib/benchmark/driver/benchmark_result.rb