Package io.opencensus.trace
Class MessageEvent
- java.lang.Object
-
- io.opencensus.trace.BaseMessageEvent
-
- io.opencensus.trace.MessageEvent
-
- Direct Known Subclasses:
AutoValue_MessageEvent
@Immutable public abstract class MessageEvent extends BaseMessageEvent
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 Classes Modifier and Type Class Description static class
MessageEvent.Builder
Builder class forMessageEvent
.static class
MessageEvent.Type
Available types for aMessageEvent
.
-
Constructor Summary
Constructors Constructor Description MessageEvent()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MessageEvent.Builder
builder(MessageEvent.Type type, long messageId)
Returns a newMessageEvent.Builder
with default values.abstract long
getCompressedMessageSize()
Returns the compressed size in bytes of theMessageEvent
.abstract long
getMessageId()
Returns the message id argument that serves to uniquely identify each message.abstract MessageEvent.Type
getType()
Returns the type of theMessageEvent
.abstract long
getUncompressedMessageSize()
Returns the uncompressed size in bytes of theMessageEvent
.
-
-
-
Method Detail
-
builder
public static MessageEvent.Builder builder(MessageEvent.Type type, long messageId)
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:
java.lang.NullPointerException
- iftype
isnull
.- Since:
- 0.12
-
getType
public abstract MessageEvent.Type 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
-
-