@@ -34,7 +34,7 @@ export default class RtcMetrics {
34
34
35
35
connectionId : string ;
36
36
37
- shouldSendMetricsOnNextStatsReport : boolean ;
37
+ shouldSendMetricsOnNextStatsReport : number ;
38
38
39
39
/**
40
40
* Initialize the interval.
@@ -70,10 +70,11 @@ export default class RtcMetrics {
70
70
* This is useful for cases when something important happens that affects the media connection,
71
71
* for example when we move from lobby into the meeting.
72
72
*
73
+ * @param {number } n - The number of next N metrics reports to send.
73
74
* @returns {void }
74
75
*/
75
- public sendNextMetrics ( ) {
76
- this . shouldSendMetricsOnNextStatsReport = true ;
76
+ public sendNextMetrics ( n = 1 ) {
77
+ this . shouldSendMetricsOnNextStatsReport = n ;
77
78
}
78
79
79
80
/**
@@ -95,7 +96,7 @@ export default class RtcMetrics {
95
96
// this is the first useful set of data (WCME gives it to us after 5s), send it out immediately
96
97
// in case the user is unhappy and closes the browser early
97
98
this . sendMetricsInQueue ( ) ;
98
- this . shouldSendMetricsOnNextStatsReport = false ;
99
+ this . shouldSendMetricsOnNextStatsReport -= 1 ;
99
100
}
100
101
101
102
try {
@@ -151,7 +152,7 @@ export default class RtcMetrics {
151
152
*/
152
153
private resetConnection ( ) {
153
154
this . connectionId = uuid . v4 ( ) ;
154
- this . shouldSendMetricsOnNextStatsReport = true ;
155
+ this . shouldSendMetricsOnNextStatsReport = 1 ;
155
156
}
156
157
157
158
/**
0 commit comments