Chromium Code Reviews| 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 |