int dropPack show %d

master
dustoair 3 years ago
parent 8d08158929
commit 64f612db4c

@ -178,9 +178,9 @@ func foot(address string, icmp_seq int, dropPack, min_lan, avg_lan, max_lan floa
icmp_seq -= 1 //最后一个seq没统计过来
fmt.Printf("\n--- %s ping statistics ---\n", address)
if dropPack >= 1 {
fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), red("lost"), dropPack/float64(icmp_seq)*100)
fmt.Printf("%d packets transmitted, %d %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), red("lost"), dropPack/float64(icmp_seq)*100)
} else {
fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), green("lost"), dropPack/float64(icmp_seq)*100)
fmt.Printf("%d packets transmitted, %d %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), green("lost"), dropPack/float64(icmp_seq)*100)
}
if len(ret_list) == 0 {

@ -23,7 +23,7 @@ mv pong /usr/bin/
pong www.baidu.com 443
```
## build
## build amd64 on vm
```bash
cd /root
rm -rf pong

Loading…
Cancel
Save