Package io.grpc.xds.client
Class LoadStatsManager2.ClusterLocalityStats
- java.lang.Object
-
- io.grpc.xds.client.LoadStatsManager2.ClusterLocalityStats
-
- Enclosing class:
- LoadStatsManager2
@ThreadSafe public final class LoadStatsManager2.ClusterLocalityStats extends java.lang.ObjectRecorder for client loads. One instance per locality (in cluster with edsService).
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicLongcallsFailedprivate java.util.concurrent.atomic.AtomicLongcallsInProgressprivate java.util.concurrent.atomic.AtomicLongcallsIssuedprivate java.util.concurrent.atomic.AtomicLongcallsSucceededprivate java.lang.StringclusterNameprivate java.lang.StringedsServiceNameprivate java.util.Map<java.lang.String,Stats.BackendLoadMetricStats>loadMetricStatsMapprivate Localitylocalityprivate com.google.common.base.Stopwatchstopwatch
-
Constructor Summary
Constructors Modifier Constructor Description privateClusterLocalityStats(java.lang.String clusterName, java.lang.String edsServiceName, Locality locality, com.google.common.base.Stopwatch stopwatch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrecordBackendLoadMetricStats(java.util.Map<java.lang.String,java.lang.Double> namedMetrics)Records all custom named backend load metric stats for per-call load reporting.voidrecordCallFinished(io.grpc.Status status)Records a request finished with the given status.voidrecordCallStarted()Records a request being issued.voidrelease()Release the hard reference for this stats object (previously obtained viaLoadStatsManager2.getClusterLocalityStats(java.lang.String, java.lang.String, io.grpc.xds.client.Locality)).private LoadStatsManager2.ClusterLocalityStatsSnapshotsnapshot()
-
-
-
Field Detail
-
clusterName
private final java.lang.String clusterName
-
edsServiceName
@Nullable private final java.lang.String edsServiceName
-
locality
private final Locality locality
-
stopwatch
private final com.google.common.base.Stopwatch stopwatch
-
callsInProgress
private final java.util.concurrent.atomic.AtomicLong callsInProgress
-
callsSucceeded
private final java.util.concurrent.atomic.AtomicLong callsSucceeded
-
callsFailed
private final java.util.concurrent.atomic.AtomicLong callsFailed
-
callsIssued
private final java.util.concurrent.atomic.AtomicLong callsIssued
-
loadMetricStatsMap
private java.util.Map<java.lang.String,Stats.BackendLoadMetricStats> loadMetricStatsMap
-
-
Constructor Detail
-
ClusterLocalityStats
private ClusterLocalityStats(java.lang.String clusterName, @Nullable java.lang.String edsServiceName, Locality locality, com.google.common.base.Stopwatch stopwatch)
-
-
Method Detail
-
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
public void recordBackendLoadMetricStats(java.util.Map<java.lang.String,java.lang.Double> namedMetrics)
Records all custom named backend load metric stats for per-call load reporting. For each metric keyname, creates a newStats.BackendLoadMetricStatswith a finished requests counter of 1 and thevalueif the key is not present in the map. Otherwise, increments the finished requests counter and adds thevalueto 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
private LoadStatsManager2.ClusterLocalityStatsSnapshot snapshot()
-
-