diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-10-29 13:22:00 +0100 |
---|---|---|
committer | Stefan Sperling <ssperling@sysmocom.de> | 2018-10-29 13:22:00 +0100 |
commit | b7974e2fa4cd260faa80c821e9c3aaab2dd8c7f0 (patch) | |
tree | 9e18336c5233f22180bcb4f1df29dfa6bebe7c6c | |
parent | 1e174875bf72c3d7840fa98cfad8c410a542919e (diff) |
show RTP TX/RX stats in 'mgcp show stats' output
Make the 'mgcp show stats' VTY command display TX/RX counters
for an RTP stream. This command was already showing the counter
for dropped packets from the same counter group, so it seems
natural to display other relevant counters in the group as well.
Change-Id: I1313e64d7d8b49964f21fc8d213cba6c9fb6c7cf
Related: OS#2660
-rw-r--r-- | src/libosmo-mgcp/mgcp_vty.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index fdcca91e7..5643180a7 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -162,11 +162,19 @@ static void dump_rtp_end(struct vty *vty, struct mgcp_conn_rtp *conn) struct mgcp_rtp_state *state = &conn->state; struct mgcp_rtp_end *end = &conn->end; struct mgcp_rtp_codec *codec = end->codec; + struct rate_ctr *tx_packets, *tx_bytes; + struct rate_ctr *rx_packets, *rx_bytes; struct rate_ctr *dropped_packets; + tx_packets = &conn->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]; + tx_bytes = &conn->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR]; + rx_packets = &conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR]; + rx_bytes = &conn->rate_ctr_group->ctr[RTP_OCTETS_RX_CTR]; dropped_packets = &conn->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]; vty_out(vty, + " Packets Sent: %" PRIu64 " (%" PRIu64 " bytes total)%s" + " Packets Received: %" PRIu64 " (%" PRIu64 " bytes total)%s" " Timestamp Errs: %" PRIu64 "->%" PRIu64 "%s" " Dropped Packets: %" PRIu64 "%s" " Payload Type: %d Rate: %u Channels: %d %s" @@ -174,6 +182,8 @@ static void dump_rtp_end(struct vty *vty, struct mgcp_conn_rtp *conn) " FPP: %d Packet Duration: %u%s" " FMTP-Extra: %s Audio-Name: %s Sub-Type: %s%s" " Output-Enabled: %d Force-PTIME: %d%s", + tx_packets->current, tx_bytes->current, VTY_NEWLINE, + rx_packets->current, rx_bytes->current, VTY_NEWLINE, state->in_stream.err_ts_ctr->current, state->out_stream.err_ts_ctr->current, VTY_NEWLINE, |