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 classprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String, GrpclbClientLoadRecorder.LongHolder> private longprivate static final AtomicLongFieldUpdater<GrpclbClientLoadRecorder> private longprivate longprivate static final AtomicLongFieldUpdater<GrpclbClientLoadRecorder> private static final AtomicLongFieldUpdater<GrpclbClientLoadRecorder> private longprivate static final AtomicLongFieldUpdater<GrpclbClientLoadRecorder> private final TimeProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) ClientStatsGenerate the report with the data recorded this LB stream since the last report.newClientStreamTracer(ClientStreamTracer.StreamInfo info, Metadata headers) Creates aClientStreamTracerfor a new client stream.(package private) voidrecordDroppedRequest(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.FactoryCreates aClientStreamTracerfor a new client stream. This is called inside the transport when it's creating the stream.- Overrides:
newClientStreamTracerin 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.
-