Top Description Constructors Methods
io.grpc

public abstract Class StreamTracer

extends Object
Class Inheritance
Known Direct Subclasses
io.grpc.ClientStreamTracer, io.grpc.ServerStreamTracer
Annotations
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/2861
@ThreadSafe
Imports
javax.annotation.concurrent.ThreadSafe

Listens to events on a stream to collect metrics.

DO NOT MOCK: Use TestStreamTracer. Mocks are not thread-safe

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
inboundMessage(int
the sequential number of the message within the stream, starting from 0. It can be used to correlate with inboundMessageRead for the same message.
seqNo
)

An inbound message has been received by the stream.

public void
inboundMessageRead(int
the sequential number of the message within the stream, starting from 0. It can be used to correlate with inboundMessage(int) for the same message.
seqNo
,
long
the wire size of the message. -1 if unknown
optionalWireSize
,
long
the uncompressed serialized size of the message. -1 if unknown
optionalUncompressedSize
)

An inbound message has been fully read from the transport.

public void
inboundUncompressedSize(long bytes)

The uncompressed size of some inbound data is revealed.

public void
inboundWireSize(long bytes)

The wire size of some inbound data is revealed.

public void
outboundMessage(int
the sequential number of the message within the stream, starting from 0. It can be used to correlate with outboundMessageSent for the same message.
seqNo
)

An outbound message has been passed to the stream.

public void
outboundMessageSent(int
the sequential number of the message within the stream, starting from 0. It can be used to correlate with outboundMessage(int) for the same message.
seqNo
,
long
the wire size of the message. -1 if unknown
optionalWireSize
,
long
the uncompressed serialized size of the message. -1 if unknown
optionalUncompressedSize
)

An outbound message has been serialized and sent to the transport.

public void
outboundUncompressedSize(long bytes)

The uncompressed size of some outbound data is revealed.

public void
outboundWireSize(long bytes)

The wire size of some outbound data is revealed.

public void
streamClosed(Status status)

Stream is closed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StreamTracerback to summary
public StreamTracer()

Method Detail

inboundMessageback to summary
public void inboundMessage(int seqNo)

An inbound message has been received by the stream. This is called as soon as the stream knows about the message, but doesn't have further guarantee such as whether the message is deserialized or not.

Parameters
seqNo:int

the sequential number of the message within the stream, starting from 0. It can be used to correlate with inboundMessageRead for the same message.

inboundMessageReadback to summary
public void inboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize)

An inbound message has been fully read from the transport.

Parameters
seqNo:int

the sequential number of the message within the stream, starting from 0. It can be used to correlate with inboundMessage(int) for the same message.

optionalWireSize:long

the wire size of the message. -1 if unknown

optionalUncompressedSize:long

the uncompressed serialized size of the message. -1 if unknown

inboundUncompressedSizeback to summary
public void inboundUncompressedSize(long bytes)

The uncompressed size of some inbound data is revealed. This can only used to record the accumulative received uncompressed size. There is no guarantee wrt timing or granularity of this method.

inboundWireSizeback to summary
public void inboundWireSize(long bytes)

The wire size of some inbound data is revealed. This can only be used to record the accumulative received wire size. There is no guarantee wrt timing or granularity of this method.

outboundMessageback to summary
public void outboundMessage(int seqNo)

An outbound message has been passed to the stream. This is called as soon as the stream knows about the message, but doesn't have further guarantee such as whether the message is serialized or not.

Parameters
seqNo:int

the sequential number of the message within the stream, starting from 0. It can be used to correlate with outboundMessageSent for the same message.

outboundMessageSentback to summary
public void outboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize)

An outbound message has been serialized and sent to the transport.

Parameters
seqNo:int

the sequential number of the message within the stream, starting from 0. It can be used to correlate with outboundMessage(int) for the same message.

optionalWireSize:long

the wire size of the message. -1 if unknown

optionalUncompressedSize:long

the uncompressed serialized size of the message. -1 if unknown

outboundUncompressedSizeback to summary
public void outboundUncompressedSize(long bytes)

The uncompressed size of some outbound data is revealed. This can only used to record the accumulative outbound uncompressed size. There is no guarantee wrt timing or granularity of this method.

outboundWireSizeback to summary
public void outboundWireSize(long bytes)

The wire size of some outbound data is revealed. This can only used to record the accumulative outbound wire size. There is no guarantee wrt timing or granularity of this method.

streamClosedback to summary
public void streamClosed(Status status)

Stream is closed. This will be called exactly once.