Class: Legion::LLM::Pipeline::Timeline
- Inherits:
-
Object
- Object
- Legion::LLM::Pipeline::Timeline
- Defined in:
- lib/legion/llm/pipeline/timeline.rb
Instance Method Summary collapse
- #events ⇒ Object
-
#initialize ⇒ Timeline
constructor
A new instance of Timeline.
- #participants ⇒ Object
- #record(category:, key:, detail:, exchange_id: nil, direction: nil, from: nil, to: nil, duration_ms: nil, data: nil) ⇒ Object
Constructor Details
#initialize ⇒ Timeline
Returns a new instance of Timeline.
7 8 9 10 11 |
# File 'lib/legion/llm/pipeline/timeline.rb', line 7 def initialize @events = [] @seq = 0 @participant_set = [] end |
Instance Method Details
#events ⇒ Object
33 34 35 |
# File 'lib/legion/llm/pipeline/timeline.rb', line 33 def events @events.dup.freeze end |
#participants ⇒ Object
37 38 39 |
# File 'lib/legion/llm/pipeline/timeline.rb', line 37 def participants @participant_set.dup.freeze end |
#record(category:, key:, detail:, exchange_id: nil, direction: nil, from: nil, to: nil, duration_ms: nil, data: nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/legion/llm/pipeline/timeline.rb', line 13 def record(category:, key:, detail:, exchange_id: nil, direction: nil, from: nil, to: nil, duration_ms: nil, data: nil) @seq += 1 @events << { seq: @seq, exchange_id: exchange_id, timestamp: Time.now, category: category, key: key, direction: direction, from: from, to: to, detail: detail, duration_ms: duration_ms, data: data } track_participant(from) track_participant(to) end |