Class MessageEvent
java.lang.Object
io.opencensus.trace.BaseMessageEvent
io.opencensus.trace.MessageEvent
- Direct Known Subclasses:
AutoValue_MessageEvent
A class that represents a generic messaging event. This class can represent messaging happened in
any layer, especially higher application layer. Thus, it can be used when recording events in
pipeline works, in-process bidirectional streams and batch processing.
It requires a type and a message id that serves to uniquely identify each
message. It can optionally have information about the message size.
- Since:
- 0.12
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class forMessageEvent.static enumAvailable types for aMessageEvent. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageEvent.Builderbuilder(MessageEvent.Type type, long messageId) Returns a newMessageEvent.Builderwith default values.abstract longReturns the compressed size in bytes of theMessageEvent.abstract longReturns the message id argument that serves to uniquely identify each message.abstract MessageEvent.TypegetType()Returns the type of theMessageEvent.abstract longReturns the uncompressed size in bytes of theMessageEvent.
-
Constructor Details
-
MessageEvent
MessageEvent()
-
-
Method Details
-
builder
Returns a newMessageEvent.Builderwith default values.- Parameters:
type- designates whether this is a send or receive message.messageId- serves to uniquely identify each message.- Returns:
- a new
Builderwith default values. - Throws:
NullPointerException- iftypeisnull.- Since:
- 0.12
-
getType
Returns the type of theMessageEvent.- Returns:
- the type of the
MessageEvent. - Since:
- 0.12
-
getMessageId
public abstract long getMessageId()Returns the message id argument that serves to uniquely identify each message.- Returns:
- the message id of the
MessageEvent. - Since:
- 0.12
-
getUncompressedMessageSize
public abstract long getUncompressedMessageSize()Returns the uncompressed size in bytes of theMessageEvent.- Returns:
- the uncompressed size in bytes of the
MessageEvent. - Since:
- 0.12
-
getCompressedMessageSize
public abstract long getCompressedMessageSize()Returns the compressed size in bytes of theMessageEvent.- Returns:
- the compressed size in bytes of the
MessageEvent. - Since:
- 0.12
-