version 1.30, 2012/01/26 17:53:53 |
version 1.31, 2012/01/29 17:58:10 |
|
|
udp_process_slice(int fd, short event, void *v_sc) |
udp_process_slice(int fd, short event, void *v_sc) |
{ |
{ |
struct statctx *sc = v_sc; |
struct statctx *sc = v_sc; |
unsigned long long total_elapsed, since_last; |
unsigned long long total_elapsed, since_last, pps; |
long double slice_mbps, pps; |
long double slice_mbps; |
struct timeval t_cur, t_diff; |
struct timeval t_cur, t_diff; |
|
|
if (clock_gettime_tv(CLOCK_MONOTONIC, &t_cur) == -1) |
if (clock_gettime_tv(CLOCK_MONOTONIC, &t_cur) == -1) |
|
|
pps = (sc->udp_slice_pkts * 1000) / since_last; |
pps = (sc->udp_slice_pkts * 1000) / since_last; |
if (slice_mbps > mainstats.peak_mbps) |
if (slice_mbps > mainstats.peak_mbps) |
mainstats.peak_mbps = slice_mbps; |
mainstats.peak_mbps = slice_mbps; |
printf("Elapsed: %11llu Mbps: %11.3Lf Peak Mbps: %11.3Lf %s PPS: %10.3Lf\n", |
printf("Elapsed: %11llu Mbps: %11.3Lf Peak Mbps: %11.3Lf %s PPS: %7llu\n", |
total_elapsed, slice_mbps, mainstats.peak_mbps, |
total_elapsed, slice_mbps, mainstats.peak_mbps, |
ptb->sflag ? "Rx" : "Tx", pps); |
ptb->sflag ? "Rx" : "Tx", pps); |
|
|