[Stats] Cleanup obsolete stats - isRemote & deleted

Deleting obsolete stats. Spec: https://www.w3.org/TR/webrtc-stats/

1. RTCInbound/OutboundRtpStats.isRemote: No longer useful with remote stream stats
2. RTCIceCandidateStats.deleted: This field was obsoleted because if the ICE candidate is deleted it no longer appears in getStats()

I also marked as many other obsoleted stats possible according to spec. I am not as confident to delete them but feel free to comment to let me know if anything is off / can be deleted.

Bug: webrtc:12583
Change-Id: I688d0076270f85caa86256349753e5f0e0a44931
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211781
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33549}
This commit is contained in:
Di Wu
2021-03-19 08:24:41 -07:00
committed by Commit Bot
parent 56db9ff1e1
commit ef036cdff2
5 changed files with 12 additions and 47 deletions

View File

@ -161,6 +161,7 @@ class RTC_EXPORT RTCIceCandidatePairStats final : public RTCStats {
// TODO(hbos): Support enum types? // TODO(hbos): Support enum types?
// "RTCStatsMember<RTCStatsIceCandidatePairState>"? // "RTCStatsMember<RTCStatsIceCandidatePairState>"?
RTCStatsMember<std::string> state; RTCStatsMember<std::string> state;
// Obsolete: priority
RTCStatsMember<uint64_t> priority; RTCStatsMember<uint64_t> priority;
RTCStatsMember<bool> nominated; RTCStatsMember<bool> nominated;
// TODO(hbos): Collect this the way the spec describes it. We have a value for // TODO(hbos): Collect this the way the spec describes it. We have a value for
@ -208,6 +209,7 @@ class RTC_EXPORT RTCIceCandidateStats : public RTCStats {
~RTCIceCandidateStats() override; ~RTCIceCandidateStats() override;
RTCStatsMember<std::string> transport_id; RTCStatsMember<std::string> transport_id;
// Obsolete: is_remote
RTCStatsMember<bool> is_remote; RTCStatsMember<bool> is_remote;
RTCStatsMember<std::string> network_type; RTCStatsMember<std::string> network_type;
RTCStatsMember<std::string> ip; RTCStatsMember<std::string> ip;
@ -220,9 +222,6 @@ class RTC_EXPORT RTCIceCandidateStats : public RTCStats {
RTCStatsMember<int32_t> priority; RTCStatsMember<int32_t> priority;
// TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723
RTCStatsMember<std::string> url; RTCStatsMember<std::string> url;
// TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|.
// crbug.com/632723
RTCStatsMember<bool> deleted; // = false
protected: protected:
RTCIceCandidateStats(const std::string& id, RTCIceCandidateStats(const std::string& id,
@ -376,6 +375,7 @@ class RTC_EXPORT RTCRTPStreamStats : public RTCStats {
RTCStatsMember<uint32_t> ssrc; RTCStatsMember<uint32_t> ssrc;
RTCStatsMember<std::string> kind; RTCStatsMember<std::string> kind;
// Obsolete: track_id
RTCStatsMember<std::string> track_id; RTCStatsMember<std::string> track_id;
RTCStatsMember<std::string> transport_id; RTCStatsMember<std::string> transport_id;
RTCStatsMember<std::string> codec_id; RTCStatsMember<std::string> codec_id;
@ -505,9 +505,6 @@ class RTC_EXPORT RTCInboundRTPStreamStats final
// audio and video but is only defined in the "video" case. crbug.com/657856 // audio and video but is only defined in the "video" case. crbug.com/657856
RTCStatsMember<uint32_t> nack_count; RTCStatsMember<uint32_t> nack_count;
RTCStatsMember<uint64_t> qp_sum; RTCStatsMember<uint64_t> qp_sum;
// Obsolete
RTCStatsMember<bool> is_remote; // = false
}; };
// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
@ -563,9 +560,6 @@ class RTC_EXPORT RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
// audio and video but is only defined in the "video" case. crbug.com/657856 // audio and video but is only defined in the "video" case. crbug.com/657856
RTCStatsMember<uint32_t> nack_count; RTCStatsMember<uint32_t> nack_count;
RTCStatsMember<uint64_t> qp_sum; RTCStatsMember<uint64_t> qp_sum;
// Obsolete
RTCStatsMember<bool> is_remote; // = false
}; };
// https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict* // https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict*

View File

@ -314,8 +314,6 @@ void SetInboundRTPStreamStatsFromMediaReceiverInfo(
RTCInboundRTPStreamStats* inbound_stats) { RTCInboundRTPStreamStats* inbound_stats) {
RTC_DCHECK(inbound_stats); RTC_DCHECK(inbound_stats);
inbound_stats->ssrc = media_receiver_info.ssrc(); inbound_stats->ssrc = media_receiver_info.ssrc();
// TODO(hbos): Support the remote case. https://crbug.com/657855
inbound_stats->is_remote = false;
inbound_stats->packets_received = inbound_stats->packets_received =
static_cast<uint32_t>(media_receiver_info.packets_rcvd); static_cast<uint32_t>(media_receiver_info.packets_rcvd);
inbound_stats->bytes_received = inbound_stats->bytes_received =
@ -496,8 +494,6 @@ void SetOutboundRTPStreamStatsFromMediaSenderInfo(
RTCOutboundRTPStreamStats* outbound_stats) { RTCOutboundRTPStreamStats* outbound_stats) {
RTC_DCHECK(outbound_stats); RTC_DCHECK(outbound_stats);
outbound_stats->ssrc = media_sender_info.ssrc(); outbound_stats->ssrc = media_sender_info.ssrc();
// TODO(hbos): Support the remote case. https://crbug.com/657856
outbound_stats->is_remote = false;
outbound_stats->packets_sent = outbound_stats->packets_sent =
static_cast<uint32_t>(media_sender_info.packets_sent); static_cast<uint32_t>(media_sender_info.packets_sent);
outbound_stats->retransmitted_packets_sent = outbound_stats->retransmitted_packets_sent =

View File

@ -1235,7 +1235,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidateStats) {
expected_a_remote_srflx.protocol = "remote_srflx's protocol"; expected_a_remote_srflx.protocol = "remote_srflx's protocol";
expected_a_remote_srflx.candidate_type = "srflx"; expected_a_remote_srflx.candidate_type = "srflx";
expected_a_remote_srflx.priority = 1; expected_a_remote_srflx.priority = 1;
expected_a_remote_srflx.deleted = false;
EXPECT_TRUE(*expected_a_remote_srflx.is_remote); EXPECT_TRUE(*expected_a_remote_srflx.is_remote);
std::unique_ptr<cricket::Candidate> a_local_prflx = CreateFakeCandidate( std::unique_ptr<cricket::Candidate> a_local_prflx = CreateFakeCandidate(
@ -1251,7 +1250,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidateStats) {
expected_a_local_prflx.protocol = "a_local_prflx's protocol"; expected_a_local_prflx.protocol = "a_local_prflx's protocol";
expected_a_local_prflx.candidate_type = "prflx"; expected_a_local_prflx.candidate_type = "prflx";
expected_a_local_prflx.priority = 2; expected_a_local_prflx.priority = 2;
expected_a_local_prflx.deleted = false;
EXPECT_FALSE(*expected_a_local_prflx.is_remote); EXPECT_FALSE(*expected_a_local_prflx.is_remote);
std::unique_ptr<cricket::Candidate> a_remote_relay = CreateFakeCandidate( std::unique_ptr<cricket::Candidate> a_remote_relay = CreateFakeCandidate(
@ -1266,7 +1264,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidateStats) {
expected_a_remote_relay.protocol = "a_remote_relay's protocol"; expected_a_remote_relay.protocol = "a_remote_relay's protocol";
expected_a_remote_relay.candidate_type = "relay"; expected_a_remote_relay.candidate_type = "relay";
expected_a_remote_relay.priority = 3; expected_a_remote_relay.priority = 3;
expected_a_remote_relay.deleted = false;
EXPECT_TRUE(*expected_a_remote_relay.is_remote); EXPECT_TRUE(*expected_a_remote_relay.is_remote);
std::unique_ptr<cricket::Candidate> a_local_relay = CreateFakeCandidate( std::unique_ptr<cricket::Candidate> a_local_relay = CreateFakeCandidate(
@ -1284,7 +1281,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidateStats) {
expected_a_local_relay.relay_protocol = "tcp"; expected_a_local_relay.relay_protocol = "tcp";
expected_a_local_relay.candidate_type = "relay"; expected_a_local_relay.candidate_type = "relay";
expected_a_local_relay.priority = 1; expected_a_local_relay.priority = 1;
expected_a_local_relay.deleted = false;
EXPECT_TRUE(*expected_a_local_relay.is_remote); EXPECT_TRUE(*expected_a_local_relay.is_remote);
// Candidates in the second transport stats. // Candidates in the second transport stats.
@ -1301,7 +1297,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidateStats) {
expected_b_local.protocol = "b_local's protocol"; expected_b_local.protocol = "b_local's protocol";
expected_b_local.candidate_type = "host"; expected_b_local.candidate_type = "host";
expected_b_local.priority = 42; expected_b_local.priority = 42;
expected_b_local.deleted = false;
EXPECT_FALSE(*expected_b_local.is_remote); EXPECT_FALSE(*expected_b_local.is_remote);
std::unique_ptr<cricket::Candidate> b_remote = CreateFakeCandidate( std::unique_ptr<cricket::Candidate> b_remote = CreateFakeCandidate(
@ -1316,7 +1311,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidateStats) {
expected_b_remote.protocol = "b_remote's protocol"; expected_b_remote.protocol = "b_remote's protocol";
expected_b_remote.candidate_type = "host"; expected_b_remote.candidate_type = "host";
expected_b_remote.priority = 42; expected_b_remote.priority = 42;
expected_b_remote.deleted = false;
EXPECT_TRUE(*expected_b_remote.is_remote); EXPECT_TRUE(*expected_b_remote.is_remote);
// Add candidate pairs to connection. // Add candidate pairs to connection.
@ -1518,7 +1512,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) {
expected_local_candidate.protocol = "protocol"; expected_local_candidate.protocol = "protocol";
expected_local_candidate.candidate_type = "host"; expected_local_candidate.candidate_type = "host";
expected_local_candidate.priority = 42; expected_local_candidate.priority = 42;
expected_local_candidate.deleted = false;
EXPECT_FALSE(*expected_local_candidate.is_remote); EXPECT_FALSE(*expected_local_candidate.is_remote);
ASSERT_TRUE(report->Get(expected_local_candidate.id())); ASSERT_TRUE(report->Get(expected_local_candidate.id()));
EXPECT_EQ(expected_local_candidate, EXPECT_EQ(expected_local_candidate,
@ -1534,7 +1527,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) {
expected_remote_candidate.protocol = "protocol"; expected_remote_candidate.protocol = "protocol";
expected_remote_candidate.candidate_type = "host"; expected_remote_candidate.candidate_type = "host";
expected_remote_candidate.priority = 42; expected_remote_candidate.priority = 42;
expected_remote_candidate.deleted = false;
EXPECT_TRUE(*expected_remote_candidate.is_remote); EXPECT_TRUE(*expected_remote_candidate.is_remote);
ASSERT_TRUE(report->Get(expected_remote_candidate.id())); ASSERT_TRUE(report->Get(expected_remote_candidate.id()));
EXPECT_EQ(expected_remote_candidate, EXPECT_EQ(expected_remote_candidate,
@ -1973,7 +1965,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) {
RTCInboundRTPStreamStats expected_audio("RTCInboundRTPAudioStream_1", RTCInboundRTPStreamStats expected_audio("RTCInboundRTPAudioStream_1",
report->timestamp_us()); report->timestamp_us());
expected_audio.ssrc = 1; expected_audio.ssrc = 1;
expected_audio.is_remote = false;
expected_audio.media_type = "audio"; expected_audio.media_type = "audio";
expected_audio.kind = "audio"; expected_audio.kind = "audio";
expected_audio.track_id = stats_of_track_type[0]->id(); expected_audio.track_id = stats_of_track_type[0]->id();
@ -2072,7 +2063,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
RTCInboundRTPStreamStats expected_video("RTCInboundRTPVideoStream_1", RTCInboundRTPStreamStats expected_video("RTCInboundRTPVideoStream_1",
report->timestamp_us()); report->timestamp_us());
expected_video.ssrc = 1; expected_video.ssrc = 1;
expected_video.is_remote = false;
expected_video.media_type = "video"; expected_video.media_type = "video";
expected_video.kind = "video"; expected_video.kind = "video";
expected_video.track_id = IdForType<RTCMediaStreamTrackStats>(report); expected_video.track_id = IdForType<RTCMediaStreamTrackStats>(report);
@ -2161,7 +2151,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) {
expected_audio.media_source_id = "RTCAudioSource_50"; expected_audio.media_source_id = "RTCAudioSource_50";
// |expected_audio.remote_id| should be undefined. // |expected_audio.remote_id| should be undefined.
expected_audio.ssrc = 1; expected_audio.ssrc = 1;
expected_audio.is_remote = false;
expected_audio.media_type = "audio"; expected_audio.media_type = "audio";
expected_audio.kind = "audio"; expected_audio.kind = "audio";
expected_audio.track_id = IdForType<RTCMediaStreamTrackStats>(report); expected_audio.track_id = IdForType<RTCMediaStreamTrackStats>(report);
@ -2245,7 +2234,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) {
expected_video.media_source_id = "RTCVideoSource_50"; expected_video.media_source_id = "RTCVideoSource_50";
// |expected_video.remote_id| should be undefined. // |expected_video.remote_id| should be undefined.
expected_video.ssrc = 1; expected_video.ssrc = 1;
expected_video.is_remote = false;
expected_video.media_type = "video"; expected_video.media_type = "video";
expected_video.kind = "video"; expected_video.kind = "video";
expected_video.track_id = stats_of_track_type[0]->id(); expected_video.track_id = stats_of_track_type[0]->id();
@ -2555,7 +2543,6 @@ TEST_F(RTCStatsCollectorTest, CollectNoStreamRTCOutboundRTPStreamStats_Audio) {
report->timestamp_us()); report->timestamp_us());
expected_audio.media_source_id = "RTCAudioSource_50"; expected_audio.media_source_id = "RTCAudioSource_50";
expected_audio.ssrc = 1; expected_audio.ssrc = 1;
expected_audio.is_remote = false;
expected_audio.media_type = "audio"; expected_audio.media_type = "audio";
expected_audio.kind = "audio"; expected_audio.kind = "audio";
expected_audio.track_id = IdForType<RTCMediaStreamTrackStats>(report); expected_audio.track_id = IdForType<RTCMediaStreamTrackStats>(report);

View File

@ -537,7 +537,6 @@ class RTCStatsReportVerifier {
verifier.TestMemberIsDefined(candidate.candidate_type); verifier.TestMemberIsDefined(candidate.candidate_type);
verifier.TestMemberIsNonNegative<int32_t>(candidate.priority); verifier.TestMemberIsNonNegative<int32_t>(candidate.priority);
verifier.TestMemberIsUndefined(candidate.url); verifier.TestMemberIsUndefined(candidate.url);
verifier.TestMemberIsDefined(candidate.deleted);
verifier.TestMemberIsUndefined(candidate.relay_protocol); verifier.TestMemberIsUndefined(candidate.relay_protocol);
return verifier.ExpectAllMembersSuccessfullyTested(); return verifier.ExpectAllMembersSuccessfullyTested();
} }
@ -830,7 +829,6 @@ class RTCStatsReportVerifier {
// this test. See RFC 3550. // this test. See RFC 3550.
verifier.TestMemberIsNonNegative<int32_t>(inbound_stream.packets_lost); verifier.TestMemberIsNonNegative<int32_t>(inbound_stream.packets_lost);
verifier.TestMemberIsDefined(inbound_stream.last_packet_received_timestamp); verifier.TestMemberIsDefined(inbound_stream.last_packet_received_timestamp);
verifier.TestMemberIsDefined(inbound_stream.is_remote);
if (inbound_stream.frames_received.ValueOrDefault(0) > 0) { if (inbound_stream.frames_received.ValueOrDefault(0) > 0) {
verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.frame_width); verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.frame_width);
verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.frame_height); verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.frame_height);
@ -961,7 +959,6 @@ class RTCStatsReportVerifier {
RTCAudioSourceStats::kType); RTCAudioSourceStats::kType);
verifier.TestMemberIsUndefined(outbound_stream.qp_sum); verifier.TestMemberIsUndefined(outbound_stream.qp_sum);
} }
verifier.TestMemberIsDefined(outbound_stream.is_remote);
verifier.TestMemberIsOptionalIDReference( verifier.TestMemberIsOptionalIDReference(
outbound_stream.remote_id, RTCRemoteInboundRtpStreamStats::kType); outbound_stream.remote_id, RTCRemoteInboundRtpStreamStats::kType);
verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.packets_sent); verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.packets_sent);

View File

@ -265,8 +265,7 @@ WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
&relay_protocol, &relay_protocol,
&candidate_type, &candidate_type,
&priority, &priority,
&url, &url)
&deleted)
// clang-format on // clang-format on
RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id, RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
@ -288,8 +287,7 @@ RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
relay_protocol("relayProtocol"), relay_protocol("relayProtocol"),
candidate_type("candidateType"), candidate_type("candidateType"),
priority("priority"), priority("priority"),
url("url"), url("url") {}
deleted("deleted", false) {}
RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other) RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
: RTCStats(other.id(), other.timestamp_us()), : RTCStats(other.id(), other.timestamp_us()),
@ -303,8 +301,7 @@ RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
relay_protocol(other.relay_protocol), relay_protocol(other.relay_protocol),
candidate_type(other.candidate_type), candidate_type(other.candidate_type),
priority(other.priority), priority(other.priority),
url(other.url), url(other.url) {}
deleted(other.deleted) {}
RTCIceCandidateStats::~RTCIceCandidateStats() {} RTCIceCandidateStats::~RTCIceCandidateStats() {}
@ -679,8 +676,7 @@ WEBRTC_RTCSTATS_IMPL(
&fir_count, &fir_count,
&pli_count, &pli_count,
&nack_count, &nack_count,
&qp_sum, &qp_sum)
&is_remote)
// clang-format on // clang-format on
RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id, RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
@ -736,8 +732,7 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
fir_count("firCount"), fir_count("firCount"),
pli_count("pliCount"), pli_count("pliCount"),
nack_count("nackCount"), nack_count("nackCount"),
qp_sum("qpSum"), qp_sum("qpSum") {}
is_remote("isRemote") {}
RTCInboundRTPStreamStats::RTCInboundRTPStreamStats( RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
const RTCInboundRTPStreamStats& other) const RTCInboundRTPStreamStats& other)
@ -789,8 +784,7 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
fir_count(other.fir_count), fir_count(other.fir_count),
pli_count(other.pli_count), pli_count(other.pli_count),
nack_count(other.nack_count), nack_count(other.nack_count),
qp_sum(other.qp_sum), qp_sum(other.qp_sum) {}
is_remote(other.is_remote) {}
RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {} RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
@ -823,8 +817,7 @@ WEBRTC_RTCSTATS_IMPL(
&fir_count, &fir_count,
&pli_count, &pli_count,
&nack_count, &nack_count,
&qp_sum, &qp_sum)
&is_remote)
// clang-format on // clang-format on
RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id, RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
@ -861,8 +854,7 @@ RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
fir_count("firCount"), fir_count("firCount"),
pli_count("pliCount"), pli_count("pliCount"),
nack_count("nackCount"), nack_count("nackCount"),
qp_sum("qpSum"), qp_sum("qpSum") {}
is_remote("isRemote") {}
RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats( RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
const RTCOutboundRTPStreamStats& other) const RTCOutboundRTPStreamStats& other)
@ -894,8 +886,7 @@ RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
fir_count(other.fir_count), fir_count(other.fir_count),
pli_count(other.pli_count), pli_count(other.pli_count),
nack_count(other.nack_count), nack_count(other.nack_count),
qp_sum(other.qp_sum), qp_sum(other.qp_sum) {}
is_remote(other.is_remote) {}
RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {} RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}