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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1311533012: Add histogram for percentage of sent frames that are limited in resolution due to bandwidth. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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 551b4b562a43904f6cfe1105d65455b2610126b9..4057f700a7e8a0a27ef20bc1bed701557d623831 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -62,6 +62,12 @@ void SendStatisticsProxy::UpdateHistograms() {
int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples);
if (encode_ms != -1)
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms);
+
+ int bw_limited = bw_limited_sent_frame_counter_.Percent(kMinRequiredSamples);
+ if (bw_limited != -1) {
+ RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BandwidthLimitedResolutionInPercent",
pbos-webrtc 2015/09/11 11:28:23 Can we report this per SSRC/simulcast layer? I thi
stefan-webrtc 2015/09/16 07:49:27 It doesn't scale very well, and as we make simulca
åsapersson 2015/09/17 14:12:03 Added the average number of resolutions disabled w
+ bw_limited);
+ }
}
void SendStatisticsProxy::OutgoingRate(const int video_channel,
@@ -162,6 +168,11 @@ void SendStatisticsProxy::OnSendEncodedImage(
stats->height = encoded_image._encodedHeight;
update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds();
+ if (encoded_image.adapt_reason_.bw_limited_resolution_available) {
+ bw_limited_sent_frame_counter_.Add(
+ encoded_image.adapt_reason_.bw_limited_resolution);
+ }
+
// TODO(asapersson): This is incorrect if simulcast layers are encoded on
// different threads and there is no guarantee that one frame of all layers
// are encoded before the next start.
@@ -274,4 +285,16 @@ int SendStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
return sum / num_samples;
}
+void SendStatisticsProxy::BoolSampleCounter::Add(bool sample) {
+ if (sample)
+ ++sum;
+ ++num_samples;
+}
+
+int SendStatisticsProxy::BoolSampleCounter::Percent(
+ int min_required_samples) const {
+ if (num_samples < min_required_samples || num_samples == 0)
+ return -1;
+ return sum * 100 / num_samples;
+}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698