TT#156052 add MOS stats to stats output

Change-Id: I9dd3847ae772ba0851239c3f230de72a2ed207ee
pull/1421/head
Richard Fuchs 4 years ago
parent 970757da2b
commit 7b5b52e932

@ -396,7 +396,13 @@ void ssrc_receiver_report(struct call_media *m, const struct ssrc_receiver_repor
};
other_e->packets_lost = rr->packets_lost;
mos_calc(ssb);
ilog(LOG_DEBUG, "Calculated MOS from RR for %s%x%s is %.1f", FMT_M(rr->from), (double) ssb->mos / 10.0);
if (ssb->mos) {
ilog(LOG_DEBUG, "Calculated MOS from RR for %s%x%s is %.1f", FMT_M(rr->from),
(double) ssb->mos / 10.0);
RTPE_STATS_ADD(mos, ssb->mos);
RTPE_STATS_ADD(mos2, ssb->mos * ssb->mos);
RTPE_STATS_INC(mos_num);
}
// got a new stats block, add it to reporting ssrc
mutex_lock(&other_e->h.lock);

@ -1,3 +1,4 @@
#include <math.h>
#include "call.h"
#include "statistics.h"
#include "graphite.h"
@ -515,6 +516,29 @@ GQueue *statistics_gather_metrics(void) {
HEADER(NULL, "");
HEADER("}", "");
HEADER("mos", "MOS statistics:");
HEADER("{", "");
uint64_t mos_num = atomic64_get(&rtpe_stats_cumulative.mos_num);
uint64_t mos_tot = atomic64_get(&rtpe_stats_cumulative.mos);
uint64_t mos2_tot = atomic64_get(&rtpe_stats_cumulative.mos2);
double mos_mean = mos_num ? (double) mos_tot / (double) mos_num : 0.0;
double mos_variance = mos_num
? fabs((double) mos2_tot / (double) mos_num - mos_mean * mos_mean)
: 0.0;
METRIC("mos_total", "Sum of all MOS values sampled", "%.6f", "%.6f",
(double) mos_tot / 10.0);
PROM("mos_total", "counter");
METRIC("mos2_total", "Sum of all MOS square values sampled", "%.6f", "%.6f",
(double) mos2_tot / 100.0);
PROM("mos2_total", "counter");
METRIC("mos_samples_total", "Total number of MOS samples", UINT64F, UINT64F, mos_num);
PROM("mos_samples_total", "counter");
METRIC("mos_average", "Average MOS", "%.6f", "%.6f", mos_mean / 10.0);
METRIC("mos_stddev", "MOS standard deviation", "%.6f", "%.6f", sqrt(mos_variance) / 10.0);
HEADER(NULL, "");
HEADER("}", "");
HEADER("controlstatistics", "Control statistics:");
HEADER("{", "");
HEADER("proxies", NULL);

@ -18,3 +18,6 @@ F(nopacket_relayed_sess)
F(oneway_stream_sess)
F(call_duration)
F(total_calls_duration_intv)
F(mos)
F(mos2)
F(mos_num)

@ -4,7 +4,6 @@
#include "aux.h"
#include "bencode.h"
#include "rtpengine_config.h"
#include "control_ng.h"
struct call;
struct packet_stream;
@ -20,6 +19,11 @@ struct stream_stats {
#endif
};
#include "control_ng.h"
// "gauge" style stats
struct global_stats_gauge {
// F(x) : real gauge that has a continuous value

@ -3,9 +3,19 @@
#include <stdlib.h>
#include "ssrc.h"
#include "main.h"
#include "statistics.h"
struct rtpengine_config rtpe_config;
struct global_stats_gauge rtpe_stats_gauge;
struct global_stats_gauge_min_max rtpe_stats_gauge_graphite_min_max;
struct global_stats_gauge_min_max rtpe_stats_gauge_graphite_min_max_interval;
struct global_stats_ax rtpe_stats;
struct global_stats_counter rtpe_stats_interval;
struct global_stats_counter rtpe_stats_cumulative;
struct global_stats_ax rtpe_stats_graphite;
struct global_stats_counter rtpe_stats_graphite_interval;
struct global_stats_min_max rtpe_stats_graphite_min_max;
struct global_stats_min_max rtpe_stats_graphite_min_max_interval;
static void most_cmp(struct payload_tracker *t, const char *cmp, const char *file, int line) {

@ -840,6 +840,33 @@ int main(void) {
"\n"
"\n"
"}\n"
"MOS statistics:\n"
"mos\n"
"\n"
"{\n"
"Sum of all MOS values sampled\n"
"mos_total\n"
"0.000000\n"
"0.000000\n"
"Sum of all MOS square values sampled\n"
"mos2_total\n"
"0.000000\n"
"0.000000\n"
"Total number of MOS samples\n"
"mos_samples_total\n"
"0\n"
"0\n"
"Average MOS\n"
"mos_average\n"
"0.000000\n"
"0.000000\n"
"MOS standard deviation\n"
"mos_stddev\n"
"0.000000\n"
"0.000000\n"
"\n"
"\n"
"}\n"
"Control statistics:\n"
"controlstatistics\n"
"\n"
@ -1682,6 +1709,33 @@ int main(void) {
"\n"
"\n"
"}\n"
"MOS statistics:\n"
"mos\n"
"\n"
"{\n"
"Sum of all MOS values sampled\n"
"mos_total\n"
"0.000000\n"
"0.000000\n"
"Sum of all MOS square values sampled\n"
"mos2_total\n"
"0.000000\n"
"0.000000\n"
"Total number of MOS samples\n"
"mos_samples_total\n"
"0\n"
"0\n"
"Average MOS\n"
"mos_average\n"
"0.000000\n"
"0.000000\n"
"MOS standard deviation\n"
"mos_stddev\n"
"0.000000\n"
"0.000000\n"
"\n"
"\n"
"}\n"
"Control statistics:\n"
"controlstatistics\n"
"\n"
@ -2521,6 +2575,33 @@ int main(void) {
"\n"
"\n"
"}\n"
"MOS statistics:\n"
"mos\n"
"\n"
"{\n"
"Sum of all MOS values sampled\n"
"mos_total\n"
"0.000000\n"
"0.000000\n"
"Sum of all MOS square values sampled\n"
"mos2_total\n"
"0.000000\n"
"0.000000\n"
"Total number of MOS samples\n"
"mos_samples_total\n"
"0\n"
"0\n"
"Average MOS\n"
"mos_average\n"
"0.000000\n"
"0.000000\n"
"MOS standard deviation\n"
"mos_stddev\n"
"0.000000\n"
"0.000000\n"
"\n"
"\n"
"}\n"
"Control statistics:\n"
"controlstatistics\n"
"\n"
@ -3373,6 +3454,33 @@ int main(void) {
"\n"
"\n"
"}\n"
"MOS statistics:\n"
"mos\n"
"\n"
"{\n"
"Sum of all MOS values sampled\n"
"mos_total\n"
"0.000000\n"
"0.000000\n"
"Sum of all MOS square values sampled\n"
"mos2_total\n"
"0.000000\n"
"0.000000\n"
"Total number of MOS samples\n"
"mos_samples_total\n"
"0\n"
"0\n"
"Average MOS\n"
"mos_average\n"
"0.000000\n"
"0.000000\n"
"MOS standard deviation\n"
"mos_stddev\n"
"0.000000\n"
"0.000000\n"
"\n"
"\n"
"}\n"
"Control statistics:\n"
"controlstatistics\n"
"\n"
@ -4220,6 +4328,33 @@ int main(void) {
"\n"
"\n"
"}\n"
"MOS statistics:\n"
"mos\n"
"\n"
"{\n"
"Sum of all MOS values sampled\n"
"mos_total\n"
"0.000000\n"
"0.000000\n"
"Sum of all MOS square values sampled\n"
"mos2_total\n"
"0.000000\n"
"0.000000\n"
"Total number of MOS samples\n"
"mos_samples_total\n"
"0\n"
"0\n"
"Average MOS\n"
"mos_average\n"
"0.000000\n"
"0.000000\n"
"MOS standard deviation\n"
"mos_stddev\n"
"0.000000\n"
"0.000000\n"
"\n"
"\n"
"}\n"
"Control statistics:\n"
"controlstatistics\n"
"\n"
@ -5062,6 +5197,33 @@ int main(void) {
"\n"
"\n"
"}\n"
"MOS statistics:\n"
"mos\n"
"\n"
"{\n"
"Sum of all MOS values sampled\n"
"mos_total\n"
"0.000000\n"
"0.000000\n"
"Sum of all MOS square values sampled\n"
"mos2_total\n"
"0.000000\n"
"0.000000\n"
"Total number of MOS samples\n"
"mos_samples_total\n"
"0\n"
"0\n"
"Average MOS\n"
"mos_average\n"
"0.000000\n"
"0.000000\n"
"MOS standard deviation\n"
"mos_stddev\n"
"0.000000\n"
"0.000000\n"
"\n"
"\n"
"}\n"
"Control statistics:\n"
"controlstatistics\n"
"\n"
@ -5906,6 +6068,33 @@ int main(void) {
"\n"
"\n"
"}\n"
"MOS statistics:\n"
"mos\n"
"\n"
"{\n"
"Sum of all MOS values sampled\n"
"mos_total\n"
"0.000000\n"
"0.000000\n"
"Sum of all MOS square values sampled\n"
"mos2_total\n"
"0.000000\n"
"0.000000\n"
"Total number of MOS samples\n"
"mos_samples_total\n"
"0\n"
"0\n"
"Average MOS\n"
"mos_average\n"
"0.000000\n"
"0.000000\n"
"MOS standard deviation\n"
"mos_stddev\n"
"0.000000\n"
"0.000000\n"
"\n"
"\n"
"}\n"
"Control statistics:\n"
"controlstatistics\n"
"\n"

Loading…
Cancel
Save