(url string, jsonBytes []byte, inFlightCount *Counter, done chan bool)
| 135 | } |
| 136 | |
| 137 | func runConstantRequestsPerSecondIteration(url string, jsonBytes []byte, inFlightCount *Counter, done chan bool) { |
| 138 | if _maxInFlight > 0 { |
| 139 | inFlightCount.Lock() |
| 140 | if inFlightCount.count >= _maxInFlight { |
| 141 | inFlightCount.Unlock() |
| 142 | fmt.Printf("\nreached max in-flight (%d)\n", _maxInFlight) |
| 143 | return |
| 144 | } |
| 145 | inFlightCount.count++ |
| 146 | inFlightCount.Unlock() |
| 147 | } |
| 148 | |
| 149 | makeRequest(url, jsonBytes) |
| 150 | |
| 151 | if _numRequests > 0 && _requestCount.Load() >= _numRequests { |
| 152 | done <- true |
| 153 | } |
| 154 | |
| 155 | if _maxInFlight > 0 { |
| 156 | inFlightCount.Lock() |
| 157 | inFlightCount.count-- |
| 158 | inFlightCount.Unlock() |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | func runConstantInFlight(url string, jsonBytes []byte) { |
| 163 | if _numRequestsPerThread > 0 { |
no test coverage detected