Package io.grpc.grpclb
Class GrpclbClientLoadRecorder
java.lang.Object
io.grpc.ClientStreamTracer.Factory
io.grpc.grpclb.GrpclbClientLoadRecorder
Record and aggregate client-side load data for GRPCLB. This records load occurred during the
span of an LB stream with the remote load-balancer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map
<String, GrpclbClientLoadRecorder.LongHolder> private long
private static final AtomicLongFieldUpdater
<GrpclbClientLoadRecorder> private long
private long
private static final AtomicLongFieldUpdater
<GrpclbClientLoadRecorder> private static final AtomicLongFieldUpdater
<GrpclbClientLoadRecorder> private long
private static final AtomicLongFieldUpdater
<GrpclbClientLoadRecorder> private final TimeProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) ClientStats
Generate the report with the data recorded this LB stream since the last report.newClientStreamTracer
(ClientStreamTracer.StreamInfo info, Metadata headers) Creates aClientStreamTracer
for a new client stream.(package private) void
recordDroppedRequest
(String token) Records that a request has been dropped as instructed by the remote balancer.
-
Field Details
-
callsStartedUpdater
-
callsFinishedUpdater
-
callsFailedToSendUpdater
-
callsFinishedKnownReceivedUpdater
private static final AtomicLongFieldUpdater<GrpclbClientLoadRecorder> callsFinishedKnownReceivedUpdater -
time
-
callsStarted
private volatile long callsStarted -
callsFinished
private volatile long callsFinished -
callsDroppedPerToken
-
callsFailedToSend
private volatile long callsFailedToSend -
callsFinishedKnownReceived
private volatile long callsFinishedKnownReceived
-
-
Constructor Details
-
GrpclbClientLoadRecorder
GrpclbClientLoadRecorder(TimeProvider time)
-
-
Method Details
-
newClientStreamTracer
public ClientStreamTracer newClientStreamTracer(ClientStreamTracer.StreamInfo info, Metadata headers) Description copied from class:ClientStreamTracer.Factory
Creates aClientStreamTracer
for a new client stream. This is called inside the transport when it's creating the stream.- Overrides:
newClientStreamTracer
in classClientStreamTracer.Factory
- Parameters:
info
- information about the streamheaders
- the mutable headers of the stream. It can be safely mutated within this method. Changes made to it will be sent by the stream. It should not be saved because it is not safe for read or write after the method returns.
-
recordDroppedRequest
Records that a request has been dropped as instructed by the remote balancer. -
generateLoadReport
ClientStats generateLoadReport()Generate the report with the data recorded this LB stream since the last report.
-