Browse Source

TT#178400 collect and report RTP sequencing metrics

Change-Id: I037b1dff876eece1d3c8d4eda715587f294c1cd6
pull/1525/head
Richard Fuchs 3 years ago
parent
commit
0558cfbc05
5 changed files with 167 additions and 0 deletions
  1. +7
    -0
      daemon/codec.c
  2. +15
    -0
      daemon/statistics.c
  3. +4
    -0
      include/counter_stats_fields.inc
  4. +1
    -0
      lib/codeclib.c
  5. +140
    -0
      t/test-stats.c

+ 7
- 0
daemon/codec.c View File

@ -1629,9 +1629,15 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa
if (func_ret != 1) if (func_ret != 1)
__transcode_packet_free(packet); __transcode_packet_free(packet);
ssrc_in_p->duplicates++; ssrc_in_p->duplicates++;
RTPE_STATS_INC(rtp_duplicates);
goto out; goto out;
} }
if (seq_ret == 1)
RTPE_STATS_INC(rtp_seq_resets);
else if (seq_ret == 2)
RTPE_STATS_INC(rtp_reordered);
// got a new packet, run decoder // got a new packet, run decoder
while (1) { while (1) {
@ -1659,6 +1665,7 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa
break; break;
ilogs(transcoding, LOG_DEBUG, "Timestamp difference too large (%llu ms) after lost packet, " ilogs(transcoding, LOG_DEBUG, "Timestamp difference too large (%llu ms) after lost packet, "
"forcing next packet", ts_diff_us / 1000); "forcing next packet", ts_diff_us / 1000);
RTPE_STATS_INC(rtp_skips);
} }
else else
break; break;


+ 15
- 0
daemon/statistics.c View File

@ -558,6 +558,21 @@ GQueue *statistics_gather_metrics(void) {
STAT_GET_PRINT(rtt_dsct, "discrete round-trip time", 1.0); STAT_GET_PRINT(rtt_dsct, "discrete round-trip time", 1.0);
STAT_GET_PRINT(packetloss, "packet loss", 1.0); STAT_GET_PRINT(packetloss, "packet loss", 1.0);
STAT_GET_PRINT(jitter_measured, "jitter (measured)", 1.0); STAT_GET_PRINT(jitter_measured, "jitter (measured)", 1.0);
METRIC("packets_lost", "Packets lost", UINT64F, UINT64F,
atomic64_get(&rtpe_stats_cumulative.packets_lost));
PROM("packets_lost", "counter");
METRIC("rtp_duplicates", "Duplicate RTP packets", UINT64F, UINT64F,
atomic64_get(&rtpe_stats_cumulative.rtp_duplicates));
PROM("rtp_duplicates", "counter");
METRIC("rtp_skips", "RTP sequence skips", UINT64F, UINT64F,
atomic64_get(&rtpe_stats_cumulative.rtp_skips));
PROM("rtp_skips", "counter");
METRIC("rtp_seq_resets", "RTP sequence resets", UINT64F, UINT64F,
atomic64_get(&rtpe_stats_cumulative.rtp_seq_resets));
PROM("rtp_seq_resets", "counter");
METRIC("rtp_reordered", "Out-of-order RTP packets", UINT64F, UINT64F,
atomic64_get(&rtpe_stats_cumulative.rtp_reordered));
PROM("rtp_reordered", "counter");
HEADER(NULL, ""); HEADER(NULL, "");
HEADER("}", ""); HEADER("}", "");


+ 4
- 0
include/counter_stats_fields.inc View File

@ -20,3 +20,7 @@ F(call_duration)
F(call_duration2) F(call_duration2)
F(total_calls_duration_intv) F(total_calls_duration_intv)
F(packets_lost) F(packets_lost)
F(rtp_duplicates)
F(rtp_skips)
F(rtp_seq_resets)
F(rtp_reordered)

+ 1
- 0
lib/codeclib.c View File

@ -1228,6 +1228,7 @@ int packet_sequencer_insert(packet_sequencer_t *ps, seq_packet_t *p) {
seq_ok: seq_ok:
if (g_tree_lookup(ps->packets, GINT_TO_POINTER(p->seq))) if (g_tree_lookup(ps->packets, GINT_TO_POINTER(p->seq)))
return -1; return -1;
ret = g_tree_nnodes(ps->packets) == 0 ? ret : 2; // indicates an out-of-order packet
g_tree_insert(ps->packets, GINT_TO_POINTER(p->seq), p); g_tree_insert(ps->packets, GINT_TO_POINTER(p->seq), p);
return ret; return ret;


+ 140
- 0
t/test-stats.c View File

@ -1004,6 +1004,26 @@ int main(void) {
"jitter_measured_stddev\n" "jitter_measured_stddev\n"
"0.000000\n" "0.000000\n"
"0.000000\n" "0.000000\n"
"Packets lost\n"
"packets_lost\n"
"0\n"
"0\n"
"Duplicate RTP packets\n"
"rtp_duplicates\n"
"0\n"
"0\n"
"RTP sequence skips\n"
"rtp_skips\n"
"0\n"
"0\n"
"RTP sequence resets\n"
"rtp_seq_resets\n"
"0\n"
"0\n"
"Out-of-order RTP packets\n"
"rtp_reordered\n"
"0\n"
"0\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -2012,6 +2032,26 @@ int main(void) {
"jitter_measured_stddev\n" "jitter_measured_stddev\n"
"0.000000\n" "0.000000\n"
"0.000000\n" "0.000000\n"
"Packets lost\n"
"packets_lost\n"
"0\n"
"0\n"
"Duplicate RTP packets\n"
"rtp_duplicates\n"
"0\n"
"0\n"
"RTP sequence skips\n"
"rtp_skips\n"
"0\n"
"0\n"
"RTP sequence resets\n"
"rtp_seq_resets\n"
"0\n"
"0\n"
"Out-of-order RTP packets\n"
"rtp_reordered\n"
"0\n"
"0\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -3017,6 +3057,26 @@ int main(void) {
"jitter_measured_stddev\n" "jitter_measured_stddev\n"
"0.000000\n" "0.000000\n"
"0.000000\n" "0.000000\n"
"Packets lost\n"
"packets_lost\n"
"0\n"
"0\n"
"Duplicate RTP packets\n"
"rtp_duplicates\n"
"0\n"
"0\n"
"RTP sequence skips\n"
"rtp_skips\n"
"0\n"
"0\n"
"RTP sequence resets\n"
"rtp_seq_resets\n"
"0\n"
"0\n"
"Out-of-order RTP packets\n"
"rtp_reordered\n"
"0\n"
"0\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -4035,6 +4095,26 @@ int main(void) {
"jitter_measured_stddev\n" "jitter_measured_stddev\n"
"0.000000\n" "0.000000\n"
"0.000000\n" "0.000000\n"
"Packets lost\n"
"packets_lost\n"
"0\n"
"0\n"
"Duplicate RTP packets\n"
"rtp_duplicates\n"
"0\n"
"0\n"
"RTP sequence skips\n"
"rtp_skips\n"
"0\n"
"0\n"
"RTP sequence resets\n"
"rtp_seq_resets\n"
"0\n"
"0\n"
"Out-of-order RTP packets\n"
"rtp_reordered\n"
"0\n"
"0\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -5048,6 +5128,26 @@ int main(void) {
"jitter_measured_stddev\n" "jitter_measured_stddev\n"
"0.000000\n" "0.000000\n"
"0.000000\n" "0.000000\n"
"Packets lost\n"
"packets_lost\n"
"0\n"
"0\n"
"Duplicate RTP packets\n"
"rtp_duplicates\n"
"0\n"
"0\n"
"RTP sequence skips\n"
"rtp_skips\n"
"0\n"
"0\n"
"RTP sequence resets\n"
"rtp_seq_resets\n"
"0\n"
"0\n"
"Out-of-order RTP packets\n"
"rtp_reordered\n"
"0\n"
"0\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -6056,6 +6156,26 @@ int main(void) {
"jitter_measured_stddev\n" "jitter_measured_stddev\n"
"0.000000\n" "0.000000\n"
"0.000000\n" "0.000000\n"
"Packets lost\n"
"packets_lost\n"
"0\n"
"0\n"
"Duplicate RTP packets\n"
"rtp_duplicates\n"
"0\n"
"0\n"
"RTP sequence skips\n"
"rtp_skips\n"
"0\n"
"0\n"
"RTP sequence resets\n"
"rtp_seq_resets\n"
"0\n"
"0\n"
"Out-of-order RTP packets\n"
"rtp_reordered\n"
"0\n"
"0\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -7066,6 +7186,26 @@ int main(void) {
"jitter_measured_stddev\n" "jitter_measured_stddev\n"
"0.000000\n" "0.000000\n"
"0.000000\n" "0.000000\n"
"Packets lost\n"
"packets_lost\n"
"0\n"
"0\n"
"Duplicate RTP packets\n"
"rtp_duplicates\n"
"0\n"
"0\n"
"RTP sequence skips\n"
"rtp_skips\n"
"0\n"
"0\n"
"RTP sequence resets\n"
"rtp_seq_resets\n"
"0\n"
"0\n"
"Out-of-order RTP packets\n"
"rtp_reordered\n"
"0\n"
"0\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"


Loading…
Cancel
Save