Module: TestBench::Telemetry::Controls::Event

Defined in:
lib/test_bench/telemetry/controls/event.rb,
lib/test_bench/telemetry/controls/event/metadata.rb

Defined Under Namespace

Modules: Data, Metadata, Other, Random

Constant Summary collapse

SomeEvent =
Telemetry::Event.define(
  :some_attribute,
  :some_other_attribute
)
SomeOtherEvent =
Telemetry::Event.define(
  :some_attribute,
  :some_other_attribute
)

Class Method Summary collapse

Class Method Details

.event_classObject



32
33
34
# File 'lib/test_bench/telemetry/controls/event.rb', line 32

def self.event_class
  SomeEvent
end

.event_dataObject



19
20
21
22
# File 'lib/test_bench/telemetry/controls/event.rb', line 19

def self.event_data
  event = self.example
  Telemetry::Event::Export.(event)
end

.example(some_attribute: nil, some_other_attribute: nil, event_class: nil, metadata: nil, process_id: nil, time: nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/test_bench/telemetry/controls/event.rb', line 5

def self.example(some_attribute: nil, some_other_attribute: nil, event_class: nil, metadata: nil, process_id: nil, time: nil)
  some_attribute ||= self.some_attribute
  some_other_attribute ||= self.some_other_attribute

   ||= Metadata.example(process_id:, time:)
  event_class ||= SomeEvent

  event = event_class.new
  event.some_attribute = some_attribute
  event.some_other_attribute = some_other_attribute
  event. = 
  event
end

.other_exampleObject



24
25
26
# File 'lib/test_bench/telemetry/controls/event.rb', line 24

def self.other_example
  Other.example
end

.process_idObject



44
45
46
# File 'lib/test_bench/telemetry/controls/event.rb', line 44

def self.process_id
  EventData.process_id
end

.randomObject



28
29
30
# File 'lib/test_bench/telemetry/controls/event.rb', line 28

def self.random
  Random.example(event_class:)
end

.some_attributeObject



36
37
38
# File 'lib/test_bench/telemetry/controls/event.rb', line 36

def self.some_attribute
  'some-value'
end

.some_other_attributeObject



40
41
42
# File 'lib/test_bench/telemetry/controls/event.rb', line 40

def self.some_other_attribute
  'some-alternate-value'
end

.timeObject



48
49
50
# File 'lib/test_bench/telemetry/controls/event.rb', line 48

def self.time
  EventData.time
end