MCPcopy
hub / github.com/grpc/grpc-go / Report

Method Report

balancer/rls/balancer.go:716–733  ·  view source on GitHub ↗

Report reports the metrics data to the provided recorder.

(r estats.AsyncMetricsRecorder)

Source from the content-addressed store, hash-verified

714
715// Report reports the metrics data to the provided recorder.
716func (b *rlsBalancer) Report(r estats.AsyncMetricsRecorder) error {
717 b.cacheMu.Lock()
718 currentSize := b.dataCache.currentSize
719 entriesLen := int64(len(b.dataCache.entries))
720 rlsServerTarget := b.dataCache.rlsServerTarget
721 grpcTarget := b.dataCache.grpcTarget
722 uuid := b.dataCache.uuid
723 shutdown := b.dataCache.shutdown.HasFired()
724 b.cacheMu.Unlock()
725
726 if shutdown {
727 return nil
728 }
729
730 cacheSizeMetric.Record(r, currentSize, grpcTarget, rlsServerTarget, uuid)
731 cacheEntriesMetric.Record(r, entriesLen, grpcTarget, rlsServerTarget, uuid)
732 return nil
733}

Callers

nothing calls this directly

Calls 4

LockMethod · 0.45
HasFiredMethod · 0.45
UnlockMethod · 0.45
RecordMethod · 0.45

Tested by

no test coverage detected