Class: CMDx::Telemetry::Event
- Inherits:
-
Data
- Object
- Data
- CMDx::Telemetry::Event
- Defined in:
- lib/cmdx/telemetry.rb
Overview
Immutable event payload passed to subscribers.
Instance Attribute Summary collapse
-
#cid ⇒ Object
readonly
Returns the value of attribute cid.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
-
#tid ⇒ Object
readonly
Returns the value of attribute tid.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#xid ⇒ Object
readonly
Returns the value of attribute xid.
Class Method Summary collapse
Instance Attribute Details
#cid ⇒ Object (readonly)
Returns the value of attribute cid
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def cid @cid end |
#name ⇒ Object (readonly)
Returns the value of attribute name
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def name @name end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def payload @payload end |
#root ⇒ Object (readonly)
Returns the value of attribute root
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def root @root end |
#task ⇒ Object (readonly)
Returns the value of attribute task
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def task @task end |
#tid ⇒ Object (readonly)
Returns the value of attribute tid
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def tid @tid end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def type @type end |
#xid ⇒ Object (readonly)
Returns the value of attribute xid
10 11 12 |
# File 'lib/cmdx/telemetry.rb', line 10 def xid @xid end |
Class Method Details
.build(task, name, root: false, payload: EMPTY_HASH) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cmdx/telemetry.rb', line 11 def self.build(task, name, root: false, payload: EMPTY_HASH) new( xid: Chain.current.xid, cid: Chain.current.id, root:, type: task.class.type, task: task.class, tid: task.tid, name:, payload:, timestamp: Time.now.utc ) end |