mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
rtp: log additional statistics
This commit is contained in:
parent
343cd38935
commit
0e778d6867
3 changed files with 23 additions and 1 deletions
|
@ -49,9 +49,18 @@ enum stats_metric {
|
|||
|
||||
STATS_METRIC_SMPS_SKIPPED, /**< Counter for skipped samples due to hooks. */
|
||||
STATS_METRIC_SMPS_REORDERED, /**< Counter for reordered samples. */
|
||||
|
||||
/* Timings */
|
||||
STATS_METRIC_GAP_SAMPLE, /**< Histogram for inter sample timestamps (as sent by remote). */
|
||||
STATS_METRIC_GAP_RECEIVED, /**< Histogram for inter sample arrival time (as seen by this instance). */
|
||||
STATS_METRIC_OWD, /**< Histogram for one-way-delay (OWD) of received samples. */
|
||||
|
||||
/* RTP metrics */
|
||||
STATS_METRIC_RTP_LOSS_FRACTION, /**< Fraction lost since last RTP SR/RR. */
|
||||
STATS_METRIC_RTP_PKTS_LOST, /**< Cumul. no. pkts lost. */
|
||||
STATS_METRIC_RTP_JITTER, /**< Interarrival jitter. */
|
||||
|
||||
/* Always last */
|
||||
STATS_METRIC_COUNT /**< Just here to have an updated number of statistics. */
|
||||
};
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ extern "C" {
|
|||
#include <villas/nodes/socket.h>
|
||||
#include <villas/nodes/rtp.hpp>
|
||||
#include <villas/utils.h>
|
||||
#include <villas/stats.h>
|
||||
#include <villas/hook.h>
|
||||
#include <villas/format_type.h>
|
||||
#include <villas/super_node.h>
|
||||
|
@ -342,7 +343,16 @@ static void rtcp_handler(const struct sa *src, struct rtcp_msg *msg, void *arg)
|
|||
if (msg->hdr.count > 0) {
|
||||
const struct rtcp_rr *rr = &msg->r.sr.rrv[0];
|
||||
debug(5, "RTP: fraction lost = %d", rr->fraction);
|
||||
rtp_aimd(n, (double) rr->fraction / 256);
|
||||
|
||||
double loss = (double) rr->fraction / 256;
|
||||
|
||||
rtp_aimd(n, loss);
|
||||
|
||||
if (n->stats) {
|
||||
stats_update(n->stats, STATS_METRIC_RTP_PKTS_LOST, rr->lost);
|
||||
stats_update(n->stats, STATS_METRIC_RTP_LOSS_FRACTION, loss);
|
||||
stats_update(n->stats, STATS_METRIC_RTP_JITTER, rr->jitter);
|
||||
}
|
||||
}
|
||||
else
|
||||
debug(5, "RTCP: Received sender report with zero reception reports");
|
||||
|
|
|
@ -37,6 +37,9 @@ struct stats_metric_description stats_metrics[] = {
|
|||
{ "gap_sent", STATS_METRIC_GAP_SAMPLE, "seconds", "Inter-message timestamps (as sent by remote)", 25 },
|
||||
{ "gap_received", STATS_METRIC_GAP_RECEIVED, "seconds", "Inter-message arrival time (as received by this instance)", 25 },
|
||||
{ "owd", STATS_METRIC_OWD, "seconds", "One-way-delay (OWD) of received messages", 25 },
|
||||
{ "rtp.loss_fraction", STATS_METRIC_RTP_LOSS_FRACTION, "percent", "Fraction lost since last RTP SR/RR.", 25 },
|
||||
{ "rtp.pkts_lost", STATS_METRIC_RTP_PKTS_LOST, "packets", "Cumulative number of packtes lost", 25 },
|
||||
{ "rtp.jitter", STATS_METRIC_RTP_JITTER, "seconds", "Interarrival jitter", 25 },
|
||||
};
|
||||
|
||||
struct stats_type_description stats_types[] = {
|
||||
|
|
Loading…
Add table
Reference in a new issue