Package io.grpc.internal
Class StatsTraceContext
- java.lang.Object
-
- io.grpc.internal.StatsTraceContext
-
@ThreadSafe public final class StatsTraceContext extends java.lang.Object
The stats and tracing information for a stream.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBoolean
closed
static StatsTraceContext
NOOP
private StreamTracer[]
tracers
-
Constructor Summary
Constructors Constructor Description StatsTraceContext(StreamTracer[] tracers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clientInboundHeaders(Metadata headers)
void
clientInboundTrailers(Metadata trailers)
void
clientOutboundHeaders()
java.util.List<StreamTracer>
getTracersForTest()
Returns a copy of the tracer list.void
inboundMessage(int seqNo)
void
inboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize)
void
inboundUncompressedSize(long bytes)
void
inboundWireSize(long bytes)
static StatsTraceContext
newClientContext(ClientStreamTracer[] tracers, Attributes transportAtts, Metadata headers)
Factory method for the client-side.static StatsTraceContext
newServerContext(java.util.List<? extends ServerStreamTracer.Factory> factories, java.lang.String fullMethodName, Metadata headers)
Factory method for the server-side.void
outboundMessage(int seqNo)
void
outboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize)
void
outboundUncompressedSize(long bytes)
void
outboundWireSize(long bytes)
void
serverCallStarted(ServerStreamTracer.ServerCallInfo<?,?> callInfo)
<ReqT,RespT>
ContextserverFilterContext(Context context)
void
streamClosed(Status status)
-
-
-
Field Detail
-
NOOP
public static final StatsTraceContext NOOP
-
tracers
private final StreamTracer[] tracers
-
closed
private final java.util.concurrent.atomic.AtomicBoolean closed
-
-
Constructor Detail
-
StatsTraceContext
StatsTraceContext(StreamTracer[] tracers)
-
-
Method Detail
-
newClientContext
public static StatsTraceContext newClientContext(ClientStreamTracer[] tracers, Attributes transportAtts, Metadata headers)
Factory method for the client-side.
-
newServerContext
public static StatsTraceContext newServerContext(java.util.List<? extends ServerStreamTracer.Factory> factories, java.lang.String fullMethodName, Metadata headers)
Factory method for the server-side.
-
getTracersForTest
public java.util.List<StreamTracer> getTracersForTest()
Returns a copy of the tracer list.
-
clientOutboundHeaders
public void clientOutboundHeaders()
SeeClientStreamTracer.outboundHeaders()
. For client-side only.Transport-specific, thus should be called by transport implementations.
-
clientInboundHeaders
public void clientInboundHeaders(Metadata headers)
SeeClientStreamTracer.inboundHeaders()
. For client-side only.Called from abstract stream implementations.
-
clientInboundTrailers
public void clientInboundTrailers(Metadata trailers)
SeeClientStreamTracer.inboundTrailers(io.grpc.Metadata)
. For client-side only.Called from abstract stream implementations.
-
serverFilterContext
public <ReqT,RespT> Context serverFilterContext(Context context)
SeeServerStreamTracer.filterContext(io.grpc.Context)
. For server-side only.Called from
ServerImpl
.
-
serverCallStarted
public void serverCallStarted(ServerStreamTracer.ServerCallInfo<?,?> callInfo)
SeeServerStreamTracer.serverCallStarted(io.grpc.ServerStreamTracer.ServerCallInfo<?, ?>)
. For server-side only.Called from
ServerImpl
.
-
streamClosed
public void streamClosed(Status status)
SeeStreamTracer.streamClosed(io.grpc.Status)
. This may be called multiple times, and only the first value will be taken.Called from abstract stream implementations.
-
outboundMessage
public void outboundMessage(int seqNo)
SeeStreamTracer.outboundMessage(int)
.Called from
Framer
.
-
inboundMessage
public void inboundMessage(int seqNo)
SeeStreamTracer.inboundMessage(int)
.Called from
MessageDeframer
.
-
outboundMessageSent
public void outboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize)
SeeStreamTracer.outboundMessageSent(int, long, long)
.Called from
Framer
.
-
inboundMessageRead
public void inboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize)
SeeStreamTracer.inboundMessageRead(int, long, long)
.Called from
MessageDeframer
.
-
outboundUncompressedSize
public void outboundUncompressedSize(long bytes)
SeeStreamTracer.outboundUncompressedSize(long)
.Called from
Framer
.
-
outboundWireSize
public void outboundWireSize(long bytes)
SeeStreamTracer.outboundWireSize(long)
.Called from
Framer
.
-
inboundUncompressedSize
public void inboundUncompressedSize(long bytes)
SeeStreamTracer.inboundUncompressedSize(long)
.Called from
MessageDeframer
.
-
inboundWireSize
public void inboundWireSize(long bytes)
SeeStreamTracer.inboundWireSize(long)
.Called from
MessageDeframer
.
-
-