Class: OpenCensus::Trace::MessageEvent
- Defined in:
- lib/opencensus/trace/message_event.rb
Overview
An event describing a message sent/received between Spans.
Constant Summary collapse
- TYPE_UNSPECIFIED =
Unknown event type.
:TYPE_UNSPECIFIED
- SENT =
Indicates a sent message.
:SENT
- RECEIVED =
Indicates a received message.
:RECEIVED
Instance Attribute Summary collapse
-
#compressed_size ⇒ Integer
readonly
The number of compressed bytes sent or received.
-
#id ⇒ Integer
readonly
An identifier for the MessageEvent’s message that can be used to match SENT and RECEIVED MessageEvents.
-
#type ⇒ Symbol
readonly
The type of MessageEvent.
-
#uncompressed_size ⇒ Integer
readonly
The number of uncompressed bytes sent or received.
Attributes inherited from TimeEvent
Instance Method Summary collapse
-
#initialize(type, id, uncompressed_size, compressed_size: 0, time: nil) ⇒ MessageEvent
constructor
Create a new MessageEvent object.
Constructor Details
#initialize(type, id, uncompressed_size, compressed_size: 0, time: nil) ⇒ MessageEvent
Create a new MessageEvent object.
70 71 72 73 74 75 76 77 |
# File 'lib/opencensus/trace/message_event.rb', line 70 def initialize type, id, uncompressed_size, compressed_size: 0, time: nil super time: time @type = type @id = id @uncompressed_size = uncompressed_size @compressed_size = compressed_size end |
Instance Attribute Details
#compressed_size ⇒ Integer (readonly)
The number of compressed bytes sent or received. If zero, assumed to be the same size as uncompressed.
63 64 65 |
# File 'lib/opencensus/trace/message_event.rb', line 63 def compressed_size @compressed_size end |
#id ⇒ Integer (readonly)
An identifier for the MessageEvent’s message that can be used to match SENT and RECEIVED MessageEvents. For example, this field could represent a sequence ID for a streaming RPC. It is recommended to be unique within a Span.
48 49 50 |
# File 'lib/opencensus/trace/message_event.rb', line 48 def id @id end |
#type ⇒ Symbol (readonly)
The type of MessageEvent. Indicates whether the message was sent or received. You should use the type constants provided by this class.
38 39 40 |
# File 'lib/opencensus/trace/message_event.rb', line 38 def type @type end |
#uncompressed_size ⇒ Integer (readonly)
The number of uncompressed bytes sent or received.
55 56 57 |
# File 'lib/opencensus/trace/message_event.rb', line 55 def uncompressed_size @uncompressed_size end |