Module: TestBench::Telemetry::Controls::Events::RunStarted

Defined in:
lib/test_bench/telemetry/controls/events/run_started.rb

Class Method Summary collapse

Class Method Details

.example(random_seed: nil, executors: nil, time: nil) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/test_bench/telemetry/controls/events/run_started.rb', line 6

def self.example(random_seed: nil, executors: nil, time: nil)
  random_seed ||= self.random_seed
  executors ||= self.executors
  time ||= self.time

  TestBench::Telemetry::Event::RunStarted.new(random_seed, executors, time)
end

.executorsObject



23
# File 'lib/test_bench/telemetry/controls/events/run_started.rb', line 23

def self.executors = 11

.randomObject



14
15
16
17
18
19
20
# File 'lib/test_bench/telemetry/controls/events/run_started.rb', line 14

def self.random
  random_seed = Random.integer
  executors = Random.integer % self.executors
  time = Time.random

  example(random_seed:, executors:, time:)
end

.random_seedObject



22
# File 'lib/test_bench/telemetry/controls/events/run_started.rb', line 22

def self.random_seed = 1

.timeObject



24
# File 'lib/test_bench/telemetry/controls/events/run_started.rb', line 24

def self.time = Time.example