File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,10 +112,9 @@ type MetricsReporter interface {
112112
113113 // RegisterAsyncReporter registers a reporter to produce metric values for
114114 // the set of metrics supported by the client. See the metrics sub-package
115- // for the specific client
116- // (e.g. internal/xds/clients/xdsclient/metrics/metrics.go) for the list of
117- // supported metrics. The returned function must be called when the metrics
118- // are no longer needed, which will remove the reporter.
115+ // for the specific client (e.g. internal/xds/clients/xdsclient/metrics/metrics.go)
116+ // for the list of supported metrics. The returned function must be called
117+ // when the metrics are no longer needed, which will remove the reporter.
119118 //
120119 // Once the returned cancel function is called, the Report method on the
121120 // registered reporter is guaranteed not to be called again.
Original file line number Diff line number Diff line change @@ -721,9 +721,8 @@ func (fc *adsFlowControl) wait() bool {
721721 return fc .stopped
722722}
723723
724-
725724func (s * adsStreamImpl ) isStreamEstablished () bool {
726- s .mu .Lock ()
727- defer s .mu .Unlock ()
728- return s .streamEstablished
725+ s .mu .Lock ()
726+ defer s .mu .Unlock ()
727+ return s .streamEstablished
729728}
Original file line number Diff line number Diff line change @@ -484,13 +484,13 @@ func (c *XDSClient) reportConnectedState(rec clients.AsyncMetricsRecorder) {
484484
485485// reportResourceStats handles the "grpc.xds_client.resources" metric.
486486func (c * XDSClient ) reportResourceStats (rec clients.AsyncMetricsRecorder ) {
487- reportForAuthority := func (a * authority ) {
488- stats := a .resourceStats ()
487+ reportForAuthority := func (auth * authority ) {
488+ stats := auth .resourceStats ()
489489 for typeURL , stateCounts := range stats {
490490 for cacheState , count := range stateCounts {
491491 if count > 0 {
492492 rec .ReportMetric (& metrics.XDSClientResourceStats {
493- Authority : a .name ,
493+ Authority : auth .name ,
494494 ResourceType : typeURL ,
495495 CacheState : cacheState ,
496496 Count : int64 (count ),
@@ -499,12 +499,11 @@ func (c *XDSClient) reportResourceStats(rec clients.AsyncMetricsRecorder) {
499499 }
500500 }
501501 }
502-
503502 if c .topLevelAuthority != nil {
504503 reportForAuthority (c .topLevelAuthority )
505504 }
506- for _ , a := range c .authorities {
507- reportForAuthority (a )
505+ for _ , auth := range c .authorities {
506+ reportForAuthority (auth )
508507 }
509508}
510509
You can’t perform that action at this time.
0 commit comments