Skip to content

Commit

Permalink
Bug 1526512 - remote-inbound-rtp stat roundTripTime should be express…
Browse files Browse the repository at this point in the history
…ed in seconds r=jib,smaug

Changing the units roundTripTime is reported in from milliseconds to seconds

Differential Revision: https://phabricator.services.mozilla.com/D19544

--HG--
extra : moz-landing-system : lando
  • Loading branch information
na-g committed Feb 12, 2019
1 parent e4b8830 commit c838f88
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dom/media/tests/mochitest/pc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1854,9 +1854,9 @@ PeerConnectionWrapper.prototype = {
}
ok(rem.jitter !== undefined, "Rtcp jitter");
if (rem.roundTripTime) {
ok(rem.roundTripTime > 0,
ok(rem.roundTripTime >= 0,
"Rtcp rtt " + rem.roundTripTime + " >= 0");
ok(rem.roundTripTime < 60000,
ok(rem.roundTripTime < 60,
"Rtcp rtt " + rem.roundTripTime + " < 1 min");
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion dom/webidl/RTCStatsReport.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dictionary RTCInboundRTPStreamStats : RTCRtpStreamStats {
unsigned long long bytesReceived;
double jitter;
unsigned long packetsLost;
long roundTripTime;
double roundTripTime;

// Video decoder measurement, not present in RTCP case
unsigned long discardedPackets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void PeerConnectionCtx::DeliverStats(RTCStatsQuery& aQuery) {
MOZ_ASSERT(isRemote);
HistogramID id = isAudio ? WEBRTC_AUDIO_QUALITY_OUTBOUND_RTT
: WEBRTC_VIDEO_QUALITY_OUTBOUND_RTT;
Accumulate(id, s.mRoundTripTime.Value());
Accumulate(id, s.mRoundTripTime.Value() * 1000);
}
if (lastReport && lastReport->mInboundRTPStreamStats.WasPassed() &&
s.mBytesReceived.WasPassed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2842,8 +2842,8 @@ RefPtr<RTCStatsQueryPromise> PeerConnectionImpl::ExecuteStatsQuery_s(
s.mPacketsReceived.Construct(packetsReceived);
s.mBytesReceived.Construct(bytesReceived);
s.mPacketsLost.Construct(packetsLost);
if (rtt > 0) {
s.mRoundTripTime.Construct(rtt);
if (rtt > 0) { // RTT is not reported when it is zero
s.mRoundTripTime.Construct(static_cast<double>(rtt) / 1000);
}
query->report->mInboundRTPStreamStats.Value().AppendElement(
s, fallible);
Expand Down
2 changes: 1 addition & 1 deletion toolkit/content/aboutwebrtc/aboutWebrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ RTPStats.prototype = {
statsString += ` ${getString("lost_label")}: ${stats.packetsLost} ${getString("jitter_label")}: ${stats.jitter}`;

if (stats.roundTripTime) {
statsString += ` RTT: ${stats.roundTripTime} ms`;
statsString += ` RTT: ${stats.roundTripTime * 1000} ms`;
}
} else if (stats.packetsSent) {
statsString += ` ${getString("sent_label")}: ${stats.packetsSent} ${getString("packets")}`;
Expand Down

0 comments on commit c838f88

Please sign in to comment.