Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions defs/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ func (s *Server) ICMPPingAndJitter(count int, srcIp, network string) (float64, f

stats := p.Statistics()

// A single figure hides how the samples were spread. The pinger already
// works these out, and the spread is what says whether a link is steady or
// merely fast on average. Raw counts rather than a loss percentage: ten
// probes are too few for a rate, and ICMP is often policed independently of
// the data path, so a percentage would say more about the server's ICMP
// handling than about the network.
output.WriteDebug("Ping over ICMP: min %.2f ms, avg %.2f ms, max %.2f ms, stddev %.2f ms, %d/%d replies\n",
float64(stats.MinRtt.Microseconds())/1000,
float64(stats.AvgRtt.Microseconds())/1000,
float64(stats.MaxRtt.Microseconds())/1000,
float64(stats.StdDevRtt.Microseconds())/1000,
stats.PacketsRecv, stats.PacketsSent)

var lastPing, jitter float64
for idx, rtt := range stats.Rtts {
if idx != 0 {
Expand Down