class MessageEvent extends TimeEvent

A class that represents a MessageEvent resource.

Traits

Trait which provides helper methods for converting DateTime input formats.

Constants

TYPE_UNSPECIFIED

TYPE_SENT

TYPE_RECEIVED

Properties

protected DateTimeInterface $time from TimeEvent

Methods

__construct(string $type, string $id, array $options = [])

Create a new MessageEvent.

time()

Return the time of this event.

from TimeEvent
setTime(DateTimeInterface|int|float $time = null)

Set the time for this event.

from TimeEvent
string
type()

Return the type of this message event.

string
id()

Return the id of this message event.

int
uncompressedSize()

Return the uncompressed size of this message event.

int
compressedSize()

Return the compressed size of this message event.

Details

at line 72
__construct(string $type, string $id, array $options = [])

Create a new MessageEvent.

Parameters

string $type Type of MessageEvent. Indicates whether the message was sent or received.
string $id 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.
array $options [optional] Configuration options.

 @type \DateTimeInterface|int|float $time The time of this event.

in TimeEvent at line 52
DateTimeInterface time()

Return the time of this event.

Return Value

DateTimeInterface

in TimeEvent at line 62
setTime(DateTimeInterface|int|float $time = null)

Set the time for this event.

Parameters

DateTimeInterface|int|float $time The time of this event.

at line 90
string type()

Return the type of this message event.

Return Value

string

at line 100
string id()

Return the id of this message event.

Return Value

string

at line 110
int uncompressedSize()

Return the uncompressed size of this message event.

Return Value

int

at line 120
int compressedSize()

Return the compressed size of this message event.

Return Value

int