Class: Perfgate::Execution::Runner
- Inherits:
-
Object
- Object
- Perfgate::Execution::Runner
- Defined in:
- lib/perfgate/execution/runner.rb
Overview
Executes a single workload's warmup and measured samples in the
current process (spec section 12.2, steps 4-9). Process isolation
across workloads is layered on top by ProcessRunner. SQL count/
duration, allocations, and GC deltas are collected only inside the
workload's explicit Perfgate.measure block; duration falls back
to wall-clock timing of the whole workload when Perfgate.measure
is never called (spec section 13.1).
A failed assertion or raised exception inside the workload is an
execution error, not a performance regression (spec section 12.2):
it aborts this workload's run and is reported as status: "error"
rather than raising out of call.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(workload) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(workload) ⇒ Runner
Returns a new instance of Runner.
21 22 23 |
# File 'lib/perfgate/execution/runner.rb', line 21 def initialize(workload) @workload = workload end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/perfgate/execution/runner.rb', line 25 def call @workload.warmup.times { run_once } samples = Array.new(@workload.samples) { run_once } result("completed", samples, nil) rescue StandardError => e result("error", [], "#{e.class}: #{e.}") end |