(c C, wg *sync.WaitGroup, pool NOClientPool, remote proto.NodeID, con int, quest int)
| 73 | } |
| 74 | |
| 75 | func testPCaller(c C, wg *sync.WaitGroup, pool NOClientPool, remote proto.NodeID, con int, quest int) { |
| 76 | defer wg.Done() |
| 77 | var finished int32 |
| 78 | caller := NewPersistentCallerWithPool(pool, remote) |
| 79 | defer caller.Close() |
| 80 | iwg := &sync.WaitGroup{} |
| 81 | defer iwg.Wait() |
| 82 | for i := 0; i < con; i++ { |
| 83 | iwg.Add(1) |
| 84 | go func(c C) { |
| 85 | defer iwg.Done() |
| 86 | for atomic.AddInt32(&finished, 1) < int32(quest) { |
| 87 | err := caller.Call("Count.Add", &AddReq{Delta: 1}, &AddResp{}) |
| 88 | c.So(err, ShouldBeNil) |
| 89 | } |
| 90 | }(c) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | func BenchmarkRPCComponents(b *testing.B) { |
| 95 | originLevel := log.GetLevel() |
no test coverage detected