doneChannelzWrapper performs the following: - increments the calls started channelz counter - wraps the done function in the passed in result to increment the calls failed or calls succeeded channelz counter before invoking the actual done function.
(acbw *acBalancerWrapper, result *balancer.PickResult)
| 74 | // failed or calls succeeded channelz counter before invoking the actual |
| 75 | // done function. |
| 76 | func doneChannelzWrapper(acbw *acBalancerWrapper, result *balancer.PickResult) { |
| 77 | ac := acbw.ac |
| 78 | ac.incrCallsStarted() |
| 79 | done := result.Done |
| 80 | result.Done = func(b balancer.DoneInfo) { |
| 81 | if b.Err != nil && b.Err != io.EOF { |
| 82 | ac.incrCallsFailed() |
| 83 | } else { |
| 84 | ac.incrCallsSucceeded() |
| 85 | } |
| 86 | if done != nil { |
| 87 | done(b) |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | type pick struct { |
| 93 | transport transport.ClientTransport // the selected transport |
no test coverage detected