Package io.grpc.xds.client
Class LoadStatsManager2.ClusterLocalityStats
java.lang.Object
io.grpc.xds.client.LoadStatsManager2.ClusterLocalityStats
- Enclosing class:
LoadStatsManager2
Recorder for client loads. One instance per locality (in cluster with edsService).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicLong
private final AtomicLong
private final AtomicLong
private final AtomicLong
private final String
private final String
private Map
<String, Stats.BackendLoadMetricStats> private final Locality
private final com.google.common.base.Stopwatch
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ClusterLocalityStats
(String clusterName, String edsServiceName, Locality locality, com.google.common.base.Stopwatch stopwatch) -
Method Summary
Modifier and TypeMethodDescriptionvoid
recordBackendLoadMetricStats
(Map<String, Double> namedMetrics) Records all custom named backend load metric stats for per-call load reporting.void
recordCallFinished
(io.grpc.Status status) Records a request finished with the given status.void
Records a request being issued.void
release()
Release the hard reference for this stats object (previously obtained viaLoadStatsManager2.getClusterLocalityStats(java.lang.String, java.lang.String, io.grpc.xds.client.Locality)
).snapshot()
-
Field Details
-
clusterName
-
edsServiceName
-
locality
-
stopwatch
private final com.google.common.base.Stopwatch stopwatch -
callsInProgress
-
callsSucceeded
-
callsFailed
-
callsIssued
-
loadMetricStatsMap
-
-
Constructor Details
-
ClusterLocalityStats
-
-
Method Details
-
recordCallStarted
public void recordCallStarted()Records a request being issued. -
recordCallFinished
public void recordCallFinished(io.grpc.Status status) Records a request finished with the given status. -
recordBackendLoadMetricStats
Records all custom named backend load metric stats for per-call load reporting. For each metric keyname
, creates a newStats.BackendLoadMetricStats
with a finished requests counter of 1 and thevalue
if the key is not present in the map. Otherwise, increments the finished requests counter and adds thevalue
to the existingStats.BackendLoadMetricStats
. -
release
public void release()Release the hard reference for this stats object (previously obtained viaLoadStatsManager2.getClusterLocalityStats(java.lang.String, java.lang.String, io.grpc.xds.client.Locality)
). The object may still be recording loads after this method, but there is no guarantee loads recorded after this point will be included in load reports. -
snapshot
-