Class: Perfgate::Workloads::Workload
- Inherits:
-
Object
- Object
- Perfgate::Workloads::Workload
- Defined in:
- lib/perfgate/workloads/workload.rb
Overview
A deterministic executable path measured by Baseline (spec section 7). Normally backed by one RSpec example, but the callable is kept generic so the execution engine can be exercised without RSpec.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#samples ⇒ Object
readonly
Returns the value of attribute samples.
-
#warmup ⇒ Object
readonly
Returns the value of attribute warmup.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(id:, samples:, warmup:, metrics: [:duration], &block) ⇒ Workload
constructor
A new instance of Workload.
Constructor Details
#initialize(id:, samples:, warmup:, metrics: [:duration], &block) ⇒ Workload
Returns a new instance of Workload.
11 12 13 14 15 16 17 18 19 |
# File 'lib/perfgate/workloads/workload.rb', line 11 def initialize(id:, samples:, warmup:, metrics: [:duration], &block) raise ArgumentError, "workload #{id.inspect} requires a block to execute" unless block @id = id @samples = samples @warmup = warmup @metrics = metrics @block = block end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/perfgate/workloads/workload.rb', line 9 def id @id end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
9 10 11 |
# File 'lib/perfgate/workloads/workload.rb', line 9 def metrics @metrics end |
#samples ⇒ Object (readonly)
Returns the value of attribute samples.
9 10 11 |
# File 'lib/perfgate/workloads/workload.rb', line 9 def samples @samples end |
#warmup ⇒ Object (readonly)
Returns the value of attribute warmup.
9 10 11 |
# File 'lib/perfgate/workloads/workload.rb', line 9 def warmup @warmup end |
Instance Method Details
#call ⇒ Object
21 22 23 |
# File 'lib/perfgate/workloads/workload.rb', line 21 def call @block.call end |