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.
148 149 150 151 |
# File 'lib/kettle/ndjson.rb', line 148 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.
153 154 155 |
# File 'lib/kettle/ndjson.rb', line 153 def phase_timings @phase_timings end |
Instance Method Details
#emit(payload) ⇒ void
This method returns an undefined value.
155 156 157 |
# File 'lib/kettle/ndjson.rb', line 155 def emit(payload) @stream&.emit(payload) end |
#record_phase_timing(payload) ⇒ void
This method returns an undefined value.
159 160 161 |
# File 'lib/kettle/ndjson.rb', line 159 def record_phase_timing(payload) @phase_timings << Kettle::Ndjson.compact_payload(payload) end |