When 1 or more ping attempts fail, avg in the return object will be NaN, though min and max are returned correctly. As a backwards compatible way of addressing this, I've added two more properties in the return object:
{
...
dropped: 1,
success_avg: 23.6245
}
dropped will show how many of the attempts errored out. success_avg will return the average of all successful pings, ignoring the errors. If all pings are successful, success_avg and avg will be equal.
Since this is an old project that gets quite a bit of use, I decided to add new properties instead of changing the existing one to avoid breaking changes. It could easily be changed to fix the existing functionality, though.
The version number was updated to 0.1.2 and README.md was updated to show the two new properties in the sample return object.
When 1 or more ping attempts fail,
avg
in the return object will beNaN
, thoughmin
andmax
are returned correctly. As a backwards compatible way of addressing this, I've added two more properties in the return object:dropped
will show how many of the attempts errored out.success_avg
will return the average of all successful pings, ignoring the errors. If all pings are successful,success_avg
andavg
will be equal.Since this is an old project that gets quite a bit of use, I decided to add new properties instead of changing the existing one to avoid breaking changes. It could easily be changed to fix the existing functionality, though.
The version number was updated to
0.1.2
andREADME.md
was updated to show the two new properties in the sample return object.