diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h index f3492ae555..3458d6fef7 100644 --- a/api/stats/rtcstats_objects.h +++ b/api/stats/rtcstats_objects.h @@ -602,9 +602,7 @@ class RTC_EXPORT RTCTransportStats final : public RTCStats { ~RTCTransportStats() override; RTCStatsMember bytes_sent; - RTCStatsMember packets_sent; RTCStatsMember bytes_received; - RTCStatsMember packets_received; RTCStatsMember rtcp_transport_stats_id; // TODO(hbos): Support enum types? "RTCStatsMember"? RTCStatsMember dtls_state; diff --git a/p2p/base/connection.cc b/p2p/base/connection.cc index 0863865a04..afb1457567 100644 --- a/p2p/base/connection.cc +++ b/p2p/base/connection.cc @@ -461,7 +461,6 @@ void Connection::OnReadPacket(const char* data, last_data_received_ = rtc::TimeMillis(); UpdateReceiving(last_data_received_); recv_rate_tracker_.AddSamples(size); - stats_.packets_received++; SignalReadPacket(this, data, size, packet_time_us); // If timed out sending writability checks, start up again diff --git a/p2p/base/connection_info.cc b/p2p/base/connection_info.cc index ebea2ab5b0..a4f8036769 100644 --- a/p2p/base/connection_info.cc +++ b/p2p/base/connection_info.cc @@ -28,7 +28,6 @@ ConnectionInfo::ConnectionInfo() sent_ping_responses(0), recv_total_bytes(0), recv_bytes_second(0), - packets_received(0), recv_ping_requests(0), recv_ping_responses(0), key(nullptr), diff --git a/p2p/base/connection_info.h b/p2p/base/connection_info.h index b5e1c14433..a62e8aec00 100644 --- a/p2p/base/connection_info.h +++ b/p2p/base/connection_info.h @@ -54,7 +54,6 @@ struct ConnectionInfo { size_t recv_total_bytes; // Total bytes received on this connection. size_t recv_bytes_second; // Bps over the last measurement interval. - size_t packets_received; // Number of packets that were received. size_t recv_ping_requests; // Number of STUN ping request received. size_t recv_ping_responses; // Number of STUN ping response received. Candidate local_candidate; // The local candidate for this connection. diff --git a/p2p/base/p2p_transport_channel_unittest.cc b/p2p/base/p2p_transport_channel_unittest.cc index cfdee81403..523e9e8bc6 100644 --- a/p2p/base/p2p_transport_channel_unittest.cc +++ b/p2p/base/p2p_transport_channel_unittest.cc @@ -1284,7 +1284,6 @@ TEST_F(P2PTransportChannelTest, GetStats) { ep2_ch1()->receiving() && ep2_ch1()->writable(), kMediumTimeout, clock); - // Sends and receives 10 packets. TestSendRecv(&clock); IceTransportStats ice_transport_stats; ASSERT_TRUE(ep1_ch1()->GetStats(&ice_transport_stats)); @@ -1307,7 +1306,6 @@ TEST_F(P2PTransportChannelTest, GetStats) { EXPECT_EQ(0U, best_conn_info->sent_discarded_packets); EXPECT_EQ(10 * 36U, best_conn_info->sent_total_bytes); EXPECT_EQ(10 * 36U, best_conn_info->recv_total_bytes); - EXPECT_EQ(10U, best_conn_info->packets_received); DestroyChannels(); } diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc index be0d90d533..07e40cba50 100644 --- a/pc/rtc_stats_collector.cc +++ b/pc/rtc_stats_collector.cc @@ -1744,9 +1744,7 @@ void RTCStatsCollector::ProduceTransportStats_n( transport_name, channel_stats.component), timestamp_us)); transport_stats->bytes_sent = 0; - transport_stats->packets_sent = 0; transport_stats->bytes_received = 0; - transport_stats->packets_received = 0; transport_stats->dtls_state = DtlsTransportStateToRTCDtlsTransportState(channel_stats.dtls_state); transport_stats->selected_candidate_pair_changes = @@ -1754,10 +1752,7 @@ void RTCStatsCollector::ProduceTransportStats_n( for (const cricket::ConnectionInfo& info : channel_stats.ice_transport_stats.connection_infos) { *transport_stats->bytes_sent += info.sent_total_bytes; - *transport_stats->packets_sent += - info.sent_total_packets - info.sent_discarded_packets; *transport_stats->bytes_received += info.recv_total_bytes; - *transport_stats->packets_received += info.packets_received; if (info.best_connection) { transport_stats->selected_candidate_pair_id = RTCIceCandidatePairStatsIDFromConnectionInfo(info); diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc index 4d3d4ba629..12898e3a7c 100644 --- a/pc/rtc_stats_collector_unittest.cc +++ b/pc/rtc_stats_collector_unittest.cc @@ -2140,9 +2140,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStats) { rtp_connection_info.remote_candidate = *rtp_remote_candidate.get(); rtp_connection_info.sent_total_bytes = 42; rtp_connection_info.recv_total_bytes = 1337; - rtp_connection_info.sent_total_packets = 3; - rtp_connection_info.sent_discarded_packets = 2; - rtp_connection_info.packets_received = 4; cricket::TransportChannelStats rtp_transport_channel_stats; rtp_transport_channel_stats.component = cricket::ICE_CANDIDATE_COMPONENT_RTP; rtp_transport_channel_stats.ice_transport_stats.connection_infos.push_back( @@ -2160,9 +2157,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStats) { rtc::ToString(cricket::ICE_CANDIDATE_COMPONENT_RTP), report->timestamp_us()); expected_rtp_transport.bytes_sent = 42; - expected_rtp_transport.packets_sent = 1; expected_rtp_transport.bytes_received = 1337; - expected_rtp_transport.packets_received = 4; expected_rtp_transport.dtls_state = RTCDtlsTransportState::kNew; expected_rtp_transport.selected_candidate_pair_changes = 1; @@ -2177,9 +2172,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStats) { rtcp_connection_info.remote_candidate = *rtcp_remote_candidate.get(); rtcp_connection_info.sent_total_bytes = 1337; rtcp_connection_info.recv_total_bytes = 42; - rtcp_connection_info.sent_total_packets = 3; - rtcp_connection_info.sent_discarded_packets = 2; - rtcp_connection_info.packets_received = 4; cricket::TransportChannelStats rtcp_transport_channel_stats; rtcp_transport_channel_stats.component = cricket::ICE_CANDIDATE_COMPONENT_RTCP; @@ -2197,9 +2189,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStats) { rtc::ToString(cricket::ICE_CANDIDATE_COMPONENT_RTCP), report->timestamp_us()); expected_rtcp_transport.bytes_sent = 1337; - expected_rtcp_transport.packets_sent = 1; expected_rtcp_transport.bytes_received = 42; - expected_rtcp_transport.packets_received = 4; expected_rtcp_transport.dtls_state = RTCDtlsTransportState::kConnecting; expected_rtcp_transport.selected_candidate_pair_changes = 0; @@ -2293,9 +2283,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStatsWithCrypto) { rtp_connection_info.remote_candidate = *rtp_remote_candidate.get(); rtp_connection_info.sent_total_bytes = 42; rtp_connection_info.recv_total_bytes = 1337; - rtp_connection_info.sent_total_packets = 3; - rtp_connection_info.sent_discarded_packets = 2; - rtp_connection_info.packets_received = 4; cricket::TransportChannelStats rtp_transport_channel_stats; rtp_transport_channel_stats.component = cricket::ICE_CANDIDATE_COMPONENT_RTP; rtp_transport_channel_stats.ice_transport_stats.connection_infos.push_back( @@ -2318,9 +2305,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStatsWithCrypto) { rtc::ToString(cricket::ICE_CANDIDATE_COMPONENT_RTP), report->timestamp_us()); expected_rtp_transport.bytes_sent = 42; - expected_rtp_transport.packets_sent = 1; expected_rtp_transport.bytes_received = 1337; - expected_rtp_transport.packets_received = 4; expected_rtp_transport.dtls_state = RTCDtlsTransportState::kConnected; expected_rtp_transport.selected_candidate_pair_changes = 1; // Crypto parameters diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc index 9e8656305d..a0fd2d0253 100644 --- a/pc/rtc_stats_integrationtest.cc +++ b/pc/rtc_stats_integrationtest.cc @@ -1014,9 +1014,7 @@ class RTCStatsReportVerifier { bool VerifyRTCTransportStats(const RTCTransportStats& transport) { RTCStatsVerifier verifier(report_, &transport); verifier.TestMemberIsNonNegative(transport.bytes_sent); - verifier.TestMemberIsNonNegative(transport.packets_sent); verifier.TestMemberIsNonNegative(transport.bytes_received); - verifier.TestMemberIsNonNegative(transport.packets_received); verifier.TestMemberIsOptionalIDReference(transport.rtcp_transport_stats_id, RTCTransportStats::kType); verifier.TestMemberIsDefined(transport.dtls_state); diff --git a/stats/rtcstats_objects.cc b/stats/rtcstats_objects.cc index ea16444554..6c7b8d2123 100644 --- a/stats/rtcstats_objects.cc +++ b/stats/rtcstats_objects.cc @@ -906,9 +906,7 @@ RTCVideoSourceStats::~RTCVideoSourceStats() {} // clang-format off WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport", &bytes_sent, - &packets_sent, &bytes_received, - &packets_received, &rtcp_transport_stats_id, &dtls_state, &selected_candidate_pair_id, @@ -927,9 +925,7 @@ RTCTransportStats::RTCTransportStats(const std::string& id, RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us) : RTCStats(std::move(id), timestamp_us), bytes_sent("bytesSent"), - packets_sent("packetsSent"), bytes_received("bytesReceived"), - packets_received("packetsReceived"), rtcp_transport_stats_id("rtcpTransportStatsId"), dtls_state("dtlsState"), selected_candidate_pair_id("selectedCandidatePairId"), @@ -943,9 +939,7 @@ RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us) RTCTransportStats::RTCTransportStats(const RTCTransportStats& other) : RTCStats(other.id(), other.timestamp_us()), bytes_sent(other.bytes_sent), - packets_sent(other.packets_sent), bytes_received(other.bytes_received), - packets_received(other.packets_received), rtcp_transport_stats_id(other.rtcp_transport_stats_id), dtls_state(other.dtls_state), selected_candidate_pair_id(other.selected_candidate_pair_id),