ping: print short stats summary on SIGQUIT
refs #2782
Change-Id: If0b85dabc7fdee6ea5ab19297122e7f322d55f22
diff --git a/tools/ping/client/statistics-collector.cpp b/tools/ping/client/statistics-collector.cpp
index b02db12..bc1956e 100644
--- a/tools/ping/client/statistics-collector.cpp
+++ b/tools/ping/client/statistics-collector.cpp
@@ -83,6 +83,16 @@
}
std::ostream&
+Statistics::printSummary(std::ostream& os) const
+{
+ os << nReceived << "/" << nSent << " packets, " << packetLossRate * 100.0
+ << "% loss, min/avg/max/mdev = " << minRtt << "/" << avgRtt << "/" << maxRtt << "/"
+ << stdDevRtt << " ms" << std::endl;
+
+ return os;
+}
+
+std::ostream&
operator<<(std::ostream& os, const Statistics& statistics)
{
os << "\n";