Open akorn opened 4 years ago
Actually, a sliding average over several different numbers of packets would also be useful (like the system load average). Say, if the average loss over the last 1000 packets is 3%, I might still think the link is good; but if the average loss over the last 25 packets it 30%, it's just going bad.
So I'd use the longer-term average to mark the link as "good" but the short-term average to mark it as "bad".
I'd argue that there are two feature requests in this:
Both seem reasonable and I would be happy to merge such pull requests.
Since load average came up: load average uses exponential decay, not a sliding window. While exponential decay is much easier to implement, I'd argue that a sliding window is more correct and much easier to grasp. For example, if you looked at the last 100 packets and the hosts goes from 0% packet loss to 100% packet loss, you'd expect the packet loss average to go from 0% to 100% in one percent point steps. With exponential decay, that is not the case.
oping(8)
currently outputs one line per packet, likeping(1)
, and summary statistics on exit.It would be useful to have an output mode where it prints statistics concerning the last
n
packets, or the lastt
seconds; something like this:The output should be line-oriented and parseable.
Use case: I have a script that monitors which of my uplinks is usable. Currently I invoke oping periodically, but it takes a while each time to get statistically significant results on e.g. packet loss. If I could instead keep oping running and read its output from a pipe, I would always have up to date statistics.