no more NaN for hitrate. closing issue #34
This commit is contained in:
parent
42650bf402
commit
7270b383d9
@ -176,6 +176,12 @@ static void monitor_update(void)
|
|||||||
number_string((zsend.sent - last_sent)/delta,
|
number_string((zsend.sent - last_sent)/delta,
|
||||||
send_rate, sizeof(send_rate));
|
send_rate, sizeof(send_rate));
|
||||||
number_string((zsend.sent/age), send_avg, sizeof(send_avg));
|
number_string((zsend.sent/age), send_avg, sizeof(send_avg));
|
||||||
|
float hits;
|
||||||
|
if (!zsend.sent) {
|
||||||
|
hits = 0;
|
||||||
|
} else {
|
||||||
|
hits = zrecv.success_unique*100./zsend.sent;
|
||||||
|
}
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%5s %0.0f%%%s; send: %u %sp/s (%sp/s avg); "
|
"%5s %0.0f%%%s; send: %u %sp/s (%sp/s avg); "
|
||||||
"recv: %u %sp/s (%sp/s avg); "
|
"recv: %u %sp/s (%sp/s avg); "
|
||||||
@ -192,7 +198,7 @@ static void monitor_update(void)
|
|||||||
recv_avg,
|
recv_avg,
|
||||||
pcap_drop,
|
pcap_drop,
|
||||||
pcap_drop_avg,
|
pcap_drop_avg,
|
||||||
zrecv.success_unique*100./zsend.sent);
|
hits);
|
||||||
} else {
|
} else {
|
||||||
// alternate display (during cooldown)
|
// alternate display (during cooldown)
|
||||||
number_string((zsend.sent/(zsend.finish - zsend.start)), send_avg, sizeof(send_avg));
|
number_string((zsend.sent/(zsend.finish - zsend.start)), send_avg, sizeof(send_avg));
|
||||||
|
Loading…
Reference in New Issue
Block a user