Package io.grpc.internal
Class ChannelTracer
- java.lang.Object
-
- io.grpc.internal.ChannelTracer
-
final class ChannelTracer extends java.lang.ObjectTracks a collections of channel tracing events for a channel/subchannel.
-
-
Field Summary
Fields Modifier and Type Field Description private longchannelCreationTimeNanosprivate java.util.Collection<InternalChannelz.ChannelTrace.Event>eventsprivate inteventsLoggedprivate java.lang.Objectlock(package private) static java.util.logging.Loggerloggerprivate InternalLogIdlogId
-
Constructor Summary
Constructors Constructor Description ChannelTracer(InternalLogId logId, int maxEvents, long channelCreationTimeNanos, java.lang.String description)Creates a channel tracer and log the creation event of the underlying channel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) InternalLogIdgetLogId()(package private) booleanisTraceEnabled()(package private) static voidlogOnly(InternalLogId logId, java.util.logging.Level logLevel, java.lang.String msg)(package private) voidreportEvent(InternalChannelz.ChannelTrace.Event event)(package private) voidtraceOnly(InternalChannelz.ChannelTrace.Event event)(package private) voidupdateBuilder(InternalChannelz.ChannelStats.Builder builder)
-
-
-
Field Detail
-
logger
static final java.util.logging.Logger logger
-
lock
private final java.lang.Object lock
-
logId
private final InternalLogId logId
-
events
@Nullable private final java.util.Collection<InternalChannelz.ChannelTrace.Event> events
-
channelCreationTimeNanos
private final long channelCreationTimeNanos
-
eventsLogged
private int eventsLogged
-
-
Constructor Detail
-
ChannelTracer
ChannelTracer(InternalLogId logId, int maxEvents, long channelCreationTimeNanos, java.lang.String description)
Creates a channel tracer and log the creation event of the underlying channel.- Parameters:
logId- logId will be prepended to the logs logged to Java loggermaxEvents- maximum number of events that are retained in memory. If not a positive number no events will be retained, but they will still be sent to the Java logger.channelCreationTimeNanos- the creation time of the entity being traceddescription- a description of the entity being traced
-
-
Method Detail
-
reportEvent
void reportEvent(InternalChannelz.ChannelTrace.Event event)
-
isTraceEnabled
boolean isTraceEnabled()
-
traceOnly
void traceOnly(InternalChannelz.ChannelTrace.Event event)
-
logOnly
static void logOnly(InternalLogId logId, java.util.logging.Level logLevel, java.lang.String msg)
-
getLogId
InternalLogId getLogId()
-
updateBuilder
void updateBuilder(InternalChannelz.ChannelStats.Builder builder)
-
-