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
typeand 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 classMessageEvent.BuilderBuilder class forMessageEvent.static classMessageEvent.TypeAvailable 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.Builderbuilder(MessageEvent.Type type, long messageId)Returns a newMessageEvent.Builderwith default values.abstract longgetCompressedMessageSize()Returns the compressed size in bytes of theMessageEvent.abstract longgetMessageId()Returns the message id argument that serves to uniquely identify each message.abstract MessageEvent.TypegetType()Returns the type of theMessageEvent.abstract longgetUncompressedMessageSize()Returns the uncompressed size in bytes of theMessageEvent.
-
-
-
Method Detail
-
builder
public static MessageEvent.Builder builder(MessageEvent.Type type, long messageId)
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:
java.lang.NullPointerException- iftypeisnull.- 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
-
-