Class: Kettle::Ndjson::EventRecorder
- Inherits:
-
Object
- Object
- Kettle::Ndjson::EventRecorder
- Defined in:
- lib/kettle/ndjson.rb,
sig/kettle/ndjson.rbs
Instance Attribute Summary collapse
-
#phase_timings ⇒ Array[Hash[Symbol, untyped]]
readonly
Returns the value of attribute phase_timings.
Instance Method Summary collapse
- #emit(payload) ⇒ void
-
#initialize(stream = nil, phase_timings = []) ⇒ EventRecorder
constructor
A new instance of EventRecorder.
- #record_phase_timing(payload) ⇒ void
Constructor Details
#initialize(stream = nil, phase_timings = []) ⇒ EventRecorder
Returns a new instance of EventRecorder.
155 156 157 158 |
# File 'lib/kettle/ndjson.rb', line 155 def initialize(stream = nil, phase_timings = []) @stream = stream @phase_timings = phase_timings end |
Instance Attribute Details
#phase_timings ⇒ Array[Hash[Symbol, untyped]] (readonly)
Returns the value of attribute phase_timings.
160 161 162 |
# File 'lib/kettle/ndjson.rb', line 160 def phase_timings @phase_timings end |
Instance Method Details
#emit(payload) ⇒ void
This method returns an undefined value.
162 163 164 |
# File 'lib/kettle/ndjson.rb', line 162 def emit(payload) @stream&.emit(payload) end |
#record_phase_timing(payload) ⇒ void
This method returns an undefined value.
166 167 168 |
# File 'lib/kettle/ndjson.rb', line 166 def record_phase_timing(payload) @phase_timings << Kettle::Ndjson.compact_payload(payload) end |