Package io.grpc.internal
Class ChannelTracer
java.lang.Object
io.grpc.internal.ChannelTracer
Tracks a collections of channel tracing events for a channel/subchannel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
private final Collection
<InternalChannelz.ChannelTrace.Event> private int
private final Object
(package private) static final Logger
private final InternalLogId
-
Constructor Summary
ConstructorsConstructorDescriptionChannelTracer
(InternalLogId logId, int maxEvents, long channelCreationTimeNanos, String description) Creates a channel tracer and log the creation event of the underlying channel. -
Method Summary
Modifier and TypeMethodDescription(package private) InternalLogId
getLogId()
(package private) boolean
(package private) static void
logOnly
(InternalLogId logId, Level logLevel, String msg) (package private) void
(package private) void
(package private) void
-
Field Details
-
logger
-
lock
-
logId
-
events
-
channelCreationTimeNanos
private final long channelCreationTimeNanos -
eventsLogged
private int eventsLogged
-
-
Constructor Details
-
ChannelTracer
ChannelTracer(InternalLogId logId, int maxEvents, long channelCreationTimeNanos, 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 Details
-
reportEvent
-
isTraceEnabled
boolean isTraceEnabled() -
traceOnly
-
logOnly
-
getLogId
InternalLogId getLogId() -
updateBuilder
-