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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 2136533002: Only update codec type histogram if lifetime is long enough (10 sec). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: updated test Created 4 years, 5 months 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
Index: webrtc/video/send_statistics_proxy.cc
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
index 6815eb3d71917a852c19d5b6fc56a469a0d9d768..47e9ac90c0010778efde0d165541fb2cbfd3dd61 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -77,16 +77,23 @@ SendStatisticsProxy::SendStatisticsProxy(
: clock_(clock),
config_(config),
content_type_(content_type),
+ start_ms_(clock->TimeInMilliseconds()),
last_sent_frame_timestamp_(0),
encode_time_(kEncodeTimeWeigthFactor),
uma_container_(
new UmaSamplesContainer(GetUmaPrefix(content_type_), stats_, clock)) {
- UpdateCodecTypeHistogram(config_.encoder_settings.payload_name);
}
SendStatisticsProxy::~SendStatisticsProxy() {
rtc::CritScope lock(&crit_);
uma_container_->UpdateHistograms(config_, stats_);
+
+ int64_t elapsed_sec = (clock_->TimeInMilliseconds() - start_ms_) / 1000;
+ RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Video.SendStreamLifetimeInSeconds",
+ elapsed_sec);
+
+ if (elapsed_sec >= metrics::kMinRunTimeInSeconds)
+ UpdateCodecTypeHistogram(config_.encoder_settings.payload_name);
}
SendStatisticsProxy::UmaSamplesContainer::UmaSamplesContainer(

Powered by Google App Engine
This is Rietveld 408576698