Before this change, pinging any target once takes ~ 100 ms (the time it
takes for Run() to return, not the RTT). After this change, it takes a
time comparable to the RTT. The change comes from ReadFrom blocking for
the specified delay if the done signal hasn't fired yet. It also
improves a little the time it takes to ping a single target multiple
times.
Since this is exponential backoff in the way Ethernet does it (random
delay, with an increasing maximum value, only changing in case of a
timeout), the delay neither necessarily doubles nor increases each time
the operation has to be retried, but it does eventually settle on the
higher end of the possibilities if there are many timeouts.
Before this change, pinging any target once takes ~ 100 ms (the time it takes for Run() to return, not the RTT). After this change, it takes a time comparable to the RTT. The change comes from ReadFrom blocking for the specified delay if the done signal hasn't fired yet. It also improves a little the time it takes to ping a single target multiple times.
Since this is exponential backoff in the way Ethernet does it (random delay, with an increasing maximum value, only changing in case of a timeout), the delay neither necessarily doubles nor increases each time the operation has to be retried, but it does eventually settle on the higher end of the possibilities if there are many timeouts.
Signed-off-by: Marcelo E. Magallon marcelo.magallon@grafana.com