From 31d29d21a13494e582aab81827ef23c66793eb0d Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 5 Oct 2023 11:58:41 +0200 Subject: [PATCH] visualize qualityLimitationReason --- import.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/import.js b/import.js index 25b9aca..ea61430 100644 --- a/import.js +++ b/import.js @@ -620,11 +620,36 @@ function processConnections(connectionIds, data) { } plotBands.push({ from: item[0], - to: (values[index + 1] || [])[0] + to: (values[index + 1] || [])[0], + label: { + align: 'center', + text: series.ssrc + ' disabled', + }, }); }); return; } + if (name === 'qualityLimitationReason' && statsType === 'outbound-rtp') { + // set up a x-axis plotbands: + // https://www.highcharts.com/docs/chart-concepts/plot-bands-and-plot-lines + data.filter((el, index, values) => { + return !(index > 0 && index < values.length - 1 && values[index - 1][1] == el[1]); + }).forEach((item, index, values) => { + if (item[1] === 'none') { + return; + } + plotBands.push({ + from: item[0], + to: (values[index + 1] || [])[0], + label: { + align: 'center', + text: item[1] + '-limited', + }, + }); + }); + return; + } + if (['encoderImplementation', 'decoderImplementation'].includes(name)) { // TODO: avoid "unknown" series[name] = data[0][1];