A Pacer defines the rate of hits during an Attack.
| 8 | |
| 9 | // A Pacer defines the rate of hits during an Attack. |
| 10 | type Pacer interface { |
| 11 | // Pace returns the duration an Attacker should wait until |
| 12 | // hitting the next Target, given an already elapsed duration and |
| 13 | // completed hits. If the second return value is true, an attacker |
| 14 | // should stop sending hits. |
| 15 | Pace(elapsed time.Duration, hits uint64) (wait time.Duration, stop bool) |
| 16 | |
| 17 | // Rate returns a Pacer's instantaneous hit rate (per seconds) |
| 18 | // at the given elapsed duration of an attack. |
| 19 | Rate(elapsed time.Duration) float64 |
| 20 | } |
| 21 | |
| 22 | // A PacerFunc is a function adapter type that implements |
| 23 | // the Pacer interface. |
no outgoing calls
no test coverage detected