Bug 1188407: switch packetloss to a rate from total-packets-lost-per-update r=jib

This commit is contained in:
Randell Jesup 2015-08-11 15:15:06 -04:00
parent d6b054a3b7
commit 8aaa21ddc0
2 changed files with 27 additions and 17 deletions

View File

@ -220,21 +220,31 @@ EverySecondTelemetryCallback_s(nsAutoPtr<RTCStatsQueries> aQueryList) {
for (decltype(array.Length()) i = 0; i < array.Length(); i++) {
auto& s = array[i];
bool isAudio = (s.mId.Value().Find("audio") != -1);
if (s.mPacketsLost.WasPassed()) {
Accumulate(s.mIsRemote?
(isAudio? WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS :
WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS) :
(isAudio? WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS :
WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS),
s.mPacketsLost.Value());
if (s.mPacketsLost.WasPassed() && s.mPacketsReceived.WasPassed() &&
(s.mPacketsLost.Value() + s.mPacketsReceived.Value()) != 0) {
ID id;
if (s.mIsRemote) {
id = isAudio ? WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS_RATE :
WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS_RATE;
} else {
id = isAudio ? WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS_RATE :
WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS_RATE;
}
// *1000 so we can read in 10's of a percent (permille)
Accumulate(id,
(s.mPacketsLost.Value() * 1000) /
(s.mPacketsLost.Value() + s.mPacketsReceived.Value()));
}
if (s.mJitter.WasPassed()) {
Accumulate(s.mIsRemote?
(isAudio? WEBRTC_AUDIO_QUALITY_OUTBOUND_JITTER :
WEBRTC_VIDEO_QUALITY_OUTBOUND_JITTER) :
(isAudio? WEBRTC_AUDIO_QUALITY_INBOUND_JITTER :
WEBRTC_VIDEO_QUALITY_INBOUND_JITTER),
s.mJitter.Value());
ID id;
if (s.mIsRemote) {
id = isAudio ? WEBRTC_AUDIO_QUALITY_OUTBOUND_JITTER :
WEBRTC_VIDEO_QUALITY_OUTBOUND_JITTER;
} else {
id = isAudio ? WEBRTC_AUDIO_QUALITY_INBOUND_JITTER :
WEBRTC_VIDEO_QUALITY_INBOUND_JITTER;
}
Accumulate(id, s.mJitter.Value());
}
if (s.mMozRtt.WasPassed()) {
MOZ_ASSERT(s.mIsRemote);

View File

@ -6194,28 +6194,28 @@
"n_buckets": 1000,
"description": "Data rate deduced from RTCP from remote recipient of outbound audio (kbit/s). Computed every second of a call (for easy comparison)."
},
"WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS": {
"WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS_RATE": {
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,
"n_buckets": 100,
"description": "Locally measured packet loss on inbound video (permille). Sampled every second of a call."
},
"WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS": {
"WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS_RATE": {
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,
"n_buckets": 100,
"description": "Locally measured packet loss on inbound audio (permille). Sampled every second of a call."
},
"WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS": {
"WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS_RATE": {
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,
"n_buckets": 100,
"description": "RTCP-reported packet loss by remote recipient of outbound video (permille). Sampled every second of a call (for easy comparison)."
},
"WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS": {
"WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS_RATE": {
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,