Class LoadStatsManager2.ClusterLocalityStats

java.lang.Object
io.grpc.xds.client.LoadStatsManager2.ClusterLocalityStats
Enclosing class:
LoadStatsManager2

@ThreadSafe public final class LoadStatsManager2.ClusterLocalityStats extends Object
Recorder for client loads. One instance per locality (in cluster with edsService).
  • Field Details

    • clusterName

      private final String clusterName
    • edsServiceName

      @Nullable private final String edsServiceName
    • locality

      private final Locality locality
    • stopwatch

      private final com.google.common.base.Stopwatch stopwatch
    • callsInProgress

      private final AtomicLong callsInProgress
    • callsSucceeded

      private final AtomicLong callsSucceeded
    • callsFailed

      private final AtomicLong callsFailed
    • callsIssued

      private final AtomicLong callsIssued
    • loadMetricStatsMap

      private Map<String, Stats.BackendLoadMetricStats> loadMetricStatsMap
  • Constructor Details

    • ClusterLocalityStats

      private ClusterLocalityStats(String clusterName, @Nullable String edsServiceName, Locality locality, com.google.common.base.Stopwatch stopwatch)
  • 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

      public void recordBackendLoadMetricStats(Map<String,Double> namedMetrics)
      Records all custom named backend load metric stats for per-call load reporting. For each metric key name, creates a new Stats.BackendLoadMetricStats with a finished requests counter of 1 and the value if the key is not present in the map. Otherwise, increments the finished requests counter and adds the value to the existing Stats.BackendLoadMetricStats.
    • release

      public void release()
      Release the hard reference for this stats object (previously obtained via LoadStatsManager2.getClusterLocalityStats(String, String, 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