Class: ExcADG::Payload::Example::Benchmark

Inherits:
Object
  • Object
show all
Includes:
ExcADG::Payload
Defined in:
lib/excadg/payload/example.rb

Overview

payload that occupies a CPU core for several seconds, is suitable for perfomance tests

Instance Attribute Summary

Attributes included from ExcADG::Payload

#args

Instance Method Summary collapse

Methods included from ExcADG::Payload

#initialize

Instance Method Details

#getObject



64
65
66
67
68
69
70
# File 'lib/excadg/payload/example.rb', line 64

def get
  lambda {
    Log.info(::Benchmark.measure {
      10_000.downto(1) { |i| 10_000.downto(1) { |j| i * j } }
    })
  }
end