Class: ImageOptim::BenchmarkResult

Inherits:
Object
  • Object
show all
Defined in:
lib/image_optim/benchmark_result.rb

Overview

Benchmark result for one worker+src

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src, dst, elapsed, worker) ⇒ BenchmarkResult

Returns a new instance of BenchmarkResult.



8
9
10
11
12
# File 'lib/image_optim/benchmark_result.rb', line 8

def initialize(src, dst, elapsed, worker)
  @bytes = bytes_saved(src, dst)
  @elapsed = elapsed
  @worker = worker.class.bin_sym.to_s
end

Instance Attribute Details

#bytesObject (readonly)

Returns the value of attribute bytes.



6
7
8
# File 'lib/image_optim/benchmark_result.rb', line 6

def bytes
  @bytes
end

#elapsedObject (readonly)

Returns the value of attribute elapsed.



6
7
8
# File 'lib/image_optim/benchmark_result.rb', line 6

def elapsed
  @elapsed
end

#workerObject (readonly)

Returns the value of attribute worker.



6
7
8
# File 'lib/image_optim/benchmark_result.rb', line 6

def worker
  @worker
end