Package io.opencensus.trace
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 class
Builder class forMessageEvent
.static enum
Available types for aMessageEvent
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageEvent.Builder
builder
(MessageEvent.Type type, long messageId) Returns a newMessageEvent.Builder
with default values.abstract long
Returns the compressed size in bytes of theMessageEvent
.abstract long
Returns the message id argument that serves to uniquely identify each message.abstract MessageEvent.Type
getType()
Returns the type of theMessageEvent
.abstract long
Returns the uncompressed size in bytes of theMessageEvent
.
-
Constructor Details
-
MessageEvent
MessageEvent()
-
-
Method Details
-
builder
Returns a newMessageEvent.Builder
with default values.- Parameters:
type
- designates whether this is a send or receive message.messageId
- serves to uniquely identify each message.- Returns:
- a new
Builder
with default values. - Throws:
NullPointerException
- iftype
isnull
.- 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
-