[CodeHealth][1/2] Remove expired histogram: WebRTC.PeerConnection.IceRegatheringReason

To remove histogram WebRTC.PeerConnection.IceRegatheringReason expired
in M77, this CL removes the supporting codebase for it.

The removal of the histogram itself will be performed in crrev.com/c/5132272 .

This CL is a part of Chrome Code Health Rotation project.

Bug: chromium:1507997
Change-Id: I856e62920578e80970ca2453c86a588141bf120d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331880
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#41436}
This commit is contained in:
Taiyo Mizuhashi 2023-12-21 12:42:54 +00:00 committed by WebRTC LUCI CQ
parent 331065829a
commit b74a3e591f
4 changed files with 5 additions and 48 deletions

View File

@ -1478,7 +1478,7 @@ TEST_F(P2PTransportChannelTest, GetStatsSwitchConnection) {
DestroyChannels();
}
// Tests that a UMA on ICE regathering is recorded when there is a network
// Tests that an ICE regathering reason is recorded when there is a network
// change if and only if continual gathering is enabled.
TEST_F(P2PTransportChannelTest,
TestIceRegatheringReasonContinualGatheringByNetworkChange) {
@ -1514,7 +1514,7 @@ TEST_F(P2PTransportChannelTest,
DestroyChannels();
}
// Tests that a UMA on ICE regathering is recorded when there is a network
// Tests that an ICE regathering reason is recorded when there is a network
// failure if and only if continual gathering is enabled.
TEST_F(P2PTransportChannelTest,
TestIceRegatheringReasonContinualGatheringByNetworkFailure) {
@ -1537,10 +1537,6 @@ TEST_F(P2PTransportChannelTest,
SIMULATED_WAIT(false, kNetworkFailureTimeout, clock);
EXPECT_LE(1, GetEndpoint(0)->GetIceRegatheringCountForReason(
IceRegatheringReason::NETWORK_FAILURE));
EXPECT_METRIC_LE(
1, webrtc::metrics::NumEvents(
"WebRTC.PeerConnection.IceRegatheringReason",
static_cast<int>(IceRegatheringReason::NETWORK_FAILURE)));
EXPECT_EQ(0, GetEndpoint(1)->GetIceRegatheringCountForReason(
IceRegatheringReason::NETWORK_FAILURE));

View File

@ -199,21 +199,6 @@ BasicPortAllocator::BasicPortAllocator(
webrtc::NO_PRUNE, nullptr);
}
void BasicPortAllocator::OnIceRegathering(PortAllocatorSession* session,
IceRegatheringReason reason) {
// If the session has not been taken by an active channel, do not report the
// metric.
for (auto& allocator_session : pooled_sessions()) {
if (allocator_session.get() == session) {
return;
}
}
RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IceRegatheringReason",
static_cast<int>(reason),
static_cast<int>(IceRegatheringReason::MAX_VALUE));
}
BasicPortAllocator::~BasicPortAllocator() {
CheckRunOnValidThreadIfInitialized();
// Our created port allocator sessions depend on us, so destroy our remaining
@ -251,12 +236,9 @@ PortAllocatorSession* BasicPortAllocator::CreateSessionInternal(
absl::string_view ice_ufrag,
absl::string_view ice_pwd) {
CheckRunOnValidThreadAndInitialized();
PortAllocatorSession* session = new BasicPortAllocatorSession(
this, std::string(content_name), component, std::string(ice_ufrag),
std::string(ice_pwd));
session->SignalIceRegathering.connect(this,
&BasicPortAllocator::OnIceRegathering);
return session;
return new BasicPortAllocatorSession(this, std::string(content_name),
component, std::string(ice_ufrag),
std::string(ice_pwd));
}
void BasicPortAllocator::AddTurnServerForTesting(

View File

@ -85,9 +85,6 @@ class RTC_EXPORT BasicPortAllocator : public PortAllocator {
}
private:
void OnIceRegathering(PortAllocatorSession* session,
IceRegatheringReason reason);
bool MdnsObfuscationEnabled() const override;
webrtc::AlwaysValidPointer<const webrtc::FieldTrialsView,

View File

@ -2390,24 +2390,6 @@ TEST_F(BasicPortAllocatorTest,
expected_stun_keepalive_interval);
}
TEST_F(BasicPortAllocatorTest, IceRegatheringMetricsLoggedWhenNetworkChanges) {
// Only test local ports to simplify test.
ResetWithNoServersOrNat();
AddInterface(kClientAddr, "test_net0");
ASSERT_TRUE(CreateSession(ICE_CANDIDATE_COMPONENT_RTP));
session_->StartGettingPorts();
EXPECT_TRUE_SIMULATED_WAIT(candidate_allocation_done_,
kDefaultAllocationTimeout, fake_clock);
candidate_allocation_done_ = false;
AddInterface(kClientAddr2, "test_net1");
EXPECT_TRUE_SIMULATED_WAIT(candidate_allocation_done_,
kDefaultAllocationTimeout, fake_clock);
EXPECT_METRIC_EQ(1,
webrtc::metrics::NumEvents(
"WebRTC.PeerConnection.IceRegatheringReason",
static_cast<int>(IceRegatheringReason::NETWORK_CHANGE)));
}
// Test that when an mDNS responder is present, the local address of a host
// candidate is concealed by an mDNS hostname and the related address of a srflx
// candidate is set to 0.0.0.0 or ::0.