merge merges the new client stats into current stats. It's a test-only method. rpcStats is defined in grpclb_picker.
(cs *lbpb.ClientStats)
| 143 | // |
| 144 | // It's a test-only method. rpcStats is defined in grpclb_picker. |
| 145 | func (s *rpcStats) merge(cs *lbpb.ClientStats) { |
| 146 | atomic.AddInt64(&s.numCallsStarted, cs.NumCallsStarted) |
| 147 | atomic.AddInt64(&s.numCallsFinished, cs.NumCallsFinished) |
| 148 | atomic.AddInt64(&s.numCallsFinishedWithClientFailedToSend, cs.NumCallsFinishedWithClientFailedToSend) |
| 149 | atomic.AddInt64(&s.numCallsFinishedKnownReceived, cs.NumCallsFinishedKnownReceived) |
| 150 | s.mu.Lock() |
| 151 | for _, perToken := range cs.CallsFinishedWithDrop { |
| 152 | s.numCallsDropped[perToken.LoadBalanceToken] += perToken.NumCalls |
| 153 | } |
| 154 | s.mu.Unlock() |
| 155 | } |
| 156 | |
| 157 | func atomicEqual(a, b *int64) bool { |
| 158 | return atomic.LoadInt64(a) == atomic.LoadInt64(b) |
no test coverage detected