NewChannelMetricForTesting creates a new instance of ChannelMetrics with specified initial values for testing purposes.
(state connectivity.State, target string, started, succeeded, failed, timestamp int64)
| 158 | // NewChannelMetricForTesting creates a new instance of ChannelMetrics with |
| 159 | // specified initial values for testing purposes. |
| 160 | func NewChannelMetricForTesting(state connectivity.State, target string, started, succeeded, failed, timestamp int64) *ChannelMetrics { |
| 161 | c := &ChannelMetrics{} |
| 162 | c.State.Store(&state) |
| 163 | c.Target.Store(&target) |
| 164 | c.CallsStarted.Store(started) |
| 165 | c.CallsSucceeded.Store(succeeded) |
| 166 | c.CallsFailed.Store(failed) |
| 167 | c.LastCallStartedTimestamp.Store(timestamp) |
| 168 | return c |
| 169 | } |
| 170 | |
| 171 | func (c *Channel) addChild(id int64, e entry) { |
| 172 | switch v := e.(type) { |
no outgoing calls