From 427af7d94a89ed25ff6c43dc1db64bf2e6d7b215 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 11 May 2007 10:36:40 +0000 Subject: [PATCH] Added IP bandwidth output in pjsua dq report git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1264 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_call.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 47dbaa725..0f4f470bd 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -1632,7 +1632,7 @@ static void dump_media_session(const char *indent, int rem_port; const char *dir; char last_update[64]; - char packets[32], bytes[32], ipbytes[32], avg_bps[32]; + char packets[32], bytes[32], ipbytes[32], avg_bps[32], avg_ipbps[32]; pj_time_val media_duration, now; pjmedia_session_get_stream_stat(session, i, &stat); @@ -1685,7 +1685,7 @@ static void dump_media_session(const char *indent, len = pj_ansi_snprintf(p, end-p, "%s RX pt=%d, stat last update: %s\n" - "%s total %spkt %sB (%sB +IP hdr) @avg=%sbps\n" + "%s total %spkt %sB (%sB +IP hdr) @avg=%sbps/%sbps\n" "%s pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)\n" "%s (msec) min avg max last\n" "%s loss period: %7.3f %7.3f %7.3f %7.3f\n" @@ -1695,8 +1695,9 @@ static void dump_media_session(const char *indent, indent, good_number(packets, stat.rx.pkt), good_number(bytes, stat.rx.bytes), - good_number(ipbytes, stat.rx.bytes + stat.rx.pkt * 32), + good_number(ipbytes, stat.rx.bytes + stat.rx.pkt * 40), good_number(avg_bps, stat.rx.bytes * 8 * 1000 / PJ_TIME_VAL_MSEC(media_duration)), + good_number(avg_ipbps, (stat.rx.bytes + stat.rx.pkt * 40) * 8 * 1000 / PJ_TIME_VAL_MSEC(media_duration)), indent, stat.rx.loss, stat.rx.loss * 100.0 / (stat.rx.pkt + stat.rx.loss), @@ -1740,7 +1741,7 @@ static void dump_media_session(const char *indent, len = pj_ansi_snprintf(p, end-p, "%s TX pt=%d, ptime=%dms, stat last update: %s\n" - "%s total %spkt %sB (%sB +IP hdr) @avg %sbps\n" + "%s total %spkt %sB (%sB +IP hdr) @avg %sbps/%sbps\n" "%s pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)\n" "%s (msec) min avg max last\n" "%s loss period: %7.3f %7.3f %7.3f %7.3f\n" @@ -1754,8 +1755,9 @@ static void dump_media_session(const char *indent, indent, good_number(packets, stat.tx.pkt), good_number(bytes, stat.tx.bytes), - good_number(ipbytes, stat.tx.bytes + stat.tx.pkt * 32), + good_number(ipbytes, stat.tx.bytes + stat.tx.pkt * 40), good_number(avg_bps, stat.tx.bytes * 8 * 1000 / PJ_TIME_VAL_MSEC(media_duration)), + good_number(avg_ipbps, (stat.tx.bytes + stat.tx.pkt * 40) * 8 * 1000 / PJ_TIME_VAL_MSEC(media_duration)), indent, stat.tx.loss,