Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2578213003: Add UMA stats to bad call detection. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy_unittest.cc
diff --git a/webrtc/video/receive_statistics_proxy_unittest.cc b/webrtc/video/receive_statistics_proxy_unittest.cc
index 74186f040c1420fd19b13c9eba26e893e3c11b6f..42729d66fc1f94803b22c2780ede5b032614cc70 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -113,6 +113,35 @@ TEST_F(ReceiveStatisticsProxyTest, LifetimeHistogramIsUpdated) {
kTimeSec));
}
+TEST_F(ReceiveStatisticsProxyTest, BadCallHistogramsAreUpdated) {
+ // Based on the tuning parameters this will produce 7 uncertain states,
+ // then 10 certainly bad states. There has to be 10 certain states before
+ // any histograms are recorded.
+ const int kNumBadSamples = 17;
+
+ StreamDataCounters counters;
+ counters.first_packet_time_ms = fake_clock_.TimeInMilliseconds();
+ statistics_proxy_->DataCountersUpdated(counters, config_.rtp.remote_ssrc);
+
+ for (int i = 0; i < kNumBadSamples; ++i) {
+ // Since OnRenderedFrame is never called the fps in each sample will be 0,
+ // i.e. bad
+ fake_clock_.AdvanceTimeMilliseconds(1000);
+ statistics_proxy_->OnIncomingRate(0, 0);
+ }
+ // Histograms are updated when the statistics_proxy_ is deleted.
+ statistics_proxy_.reset();
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.BadCall.Any"));
+ EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.BadCall.Any", 100));
+
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.BadCall.FrameRate"));
+ EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.BadCall.FrameRate", 100));
+
+ EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.BadCall.FrameRateVariance"));
+
+ EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.BadCall.Qp"));
+}
+
TEST_F(ReceiveStatisticsProxyTest, PacketLossHistogramIsUpdated) {
const uint32_t kCumLost1 = 1;
const uint32_t kExtSeqNum1 = 10;
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698