(cc *grpc.ClientConn, req *testpb.SimpleRequest, warmDeadline, endDeadline time.Time)
| 147 | } |
| 148 | |
| 149 | func runWithConn(cc *grpc.ClientConn, req *testpb.SimpleRequest, warmDeadline, endDeadline time.Time) { |
| 150 | for i := 0; i < *numRPC; i++ { |
| 151 | wg.Add(1) |
| 152 | go func() { |
| 153 | defer wg.Done() |
| 154 | caller := makeCaller(cc, req) |
| 155 | hist := stats.NewHistogram(hopts) |
| 156 | for { |
| 157 | start := time.Now() |
| 158 | if start.After(endDeadline) { |
| 159 | mu.Lock() |
| 160 | hists = append(hists, hist) |
| 161 | mu.Unlock() |
| 162 | return |
| 163 | } |
| 164 | caller() |
| 165 | elapsed := time.Since(start) |
| 166 | if start.After(warmDeadline) { |
| 167 | hist.Add(elapsed.Nanoseconds()) |
| 168 | } |
| 169 | } |
| 170 | }() |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | func makeCaller(cc *grpc.ClientConn, req *testpb.SimpleRequest) func() { |
| 175 | client := testgrpc.NewBenchmarkServiceClient(cc) |
no test coverage detected