| Index: webrtc/video/send_statistics_proxy.cc
|
| diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
|
| index 5c2052a207868d9c6b2e5c7bd4e7edbb0a83d7e1..263283d92db361a789e7502a4aa7cb9173692240 100644
|
| --- a/webrtc/video/send_statistics_proxy.cc
|
| +++ b/webrtc/video/send_statistics_proxy.cc
|
| @@ -31,6 +31,18 @@ enum HistogramCodecType {
|
| kVideoMax = 64,
|
| };
|
|
|
| +const char* GetUmaPrefix(const VideoEncoderConfig& config) {
|
| + switch (config.content_type) {
|
| + case VideoEncoderConfig::ContentType::kRealtimeVideo:
|
| + return "WebRTC.Video.";
|
| + case VideoEncoderConfig::ContentType::kScreen:
|
| + return "WebRTC.Video.Screenshare.";
|
| + default:
|
| + RTC_NOTREACHED() << "Unknown content type.";
|
| + return "";
|
| + }
|
| +}
|
| +
|
| HistogramCodecType PayloadNameToHistogramCodecType(
|
| const std::string& payload_name) {
|
| if (payload_name == "VP8") {
|
| @@ -53,10 +65,13 @@ void UpdateCodecTypeHistogram(const std::string& payload_name) {
|
|
|
| const int SendStatisticsProxy::kStatsTimeoutMs = 5000;
|
|
|
| -SendStatisticsProxy::SendStatisticsProxy(Clock* clock,
|
| - const VideoSendStream::Config& config)
|
| +SendStatisticsProxy::SendStatisticsProxy(
|
| + Clock* clock,
|
| + const VideoSendStream::Config& config,
|
| + const VideoEncoderConfig& encoder_config)
|
| : clock_(clock),
|
| config_(config),
|
| + uma_prefix_(GetUmaPrefix(encoder_config)),
|
| input_frame_rate_tracker_(100u, 10u),
|
| sent_frame_rate_tracker_(100u, 10u),
|
| last_sent_frame_timestamp_(0),
|
| @@ -75,56 +90,56 @@ void SendStatisticsProxy::UpdateHistograms() {
|
| int in_height = input_height_counter_.Avg(kMinRequiredSamples);
|
| int in_fps = round(input_frame_rate_tracker_.ComputeTotalRate());
|
| if (in_width != -1) {
|
| - RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.InputWidthInPixels", in_width);
|
| - RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.InputHeightInPixels", in_height);
|
| - RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.InputFramesPerSecond", in_fps);
|
| + RTC_HISTOGRAM_COUNTS_10000(uma_prefix_ + "InputWidthInPixels", in_width);
|
| + RTC_HISTOGRAM_COUNTS_10000(uma_prefix_ + "InputHeightInPixels", in_height);
|
| + RTC_HISTOGRAM_COUNTS_100(uma_prefix_ + "InputFramesPerSecond", in_fps);
|
| }
|
| int sent_width = sent_width_counter_.Avg(kMinRequiredSamples);
|
| int sent_height = sent_height_counter_.Avg(kMinRequiredSamples);
|
| int sent_fps = round(sent_frame_rate_tracker_.ComputeTotalRate());
|
| if (sent_width != -1) {
|
| - RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentWidthInPixels", sent_width);
|
| - RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentHeightInPixels", sent_height);
|
| - RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps);
|
| + RTC_HISTOGRAM_COUNTS_10000(uma_prefix_ + "SentWidthInPixels", sent_width);
|
| + RTC_HISTOGRAM_COUNTS_10000(uma_prefix_ + "SentHeightInPixels", sent_height);
|
| + RTC_HISTOGRAM_COUNTS_100(uma_prefix_ + "SentFramesPerSecond", sent_fps);
|
| }
|
| int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples);
|
| if (encode_ms != -1)
|
| - RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms);
|
| + RTC_HISTOGRAM_COUNTS_1000(uma_prefix_ + "EncodeTimeInMs", encode_ms);
|
|
|
| int key_frames_permille = key_frame_counter_.Permille(kMinRequiredSamples);
|
| if (key_frames_permille != -1) {
|
| - RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesSentInPermille",
|
| - key_frames_permille);
|
| + RTC_HISTOGRAM_COUNTS_1000(uma_prefix_ + "KeyFramesSentInPermille",
|
| + key_frames_permille);
|
| }
|
| int quality_limited =
|
| quality_limited_frame_counter_.Percent(kMinRequiredSamples);
|
| if (quality_limited != -1) {
|
| - RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.QualityLimitedResolutionInPercent",
|
| + RTC_HISTOGRAM_PERCENTAGE(uma_prefix_ + "QualityLimitedResolutionInPercent",
|
| quality_limited);
|
| }
|
| int downscales = quality_downscales_counter_.Avg(kMinRequiredSamples);
|
| if (downscales != -1) {
|
| - RTC_HISTOGRAM_ENUMERATION("WebRTC.Video.QualityLimitedResolutionDownscales",
|
| - downscales, 20);
|
| + RTC_HISTOGRAM_ENUMERATION(
|
| + uma_prefix_ + "QualityLimitedResolutionDownscales", downscales, 20);
|
| }
|
| int bw_limited = bw_limited_frame_counter_.Percent(kMinRequiredSamples);
|
| if (bw_limited != -1) {
|
| - RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BandwidthLimitedResolutionInPercent",
|
| - bw_limited);
|
| + RTC_HISTOGRAM_PERCENTAGE(
|
| + uma_prefix_ + "BandwidthLimitedResolutionInPercent", bw_limited);
|
| }
|
| int num_disabled = bw_resolutions_disabled_counter_.Avg(kMinRequiredSamples);
|
| if (num_disabled != -1) {
|
| RTC_HISTOGRAM_ENUMERATION(
|
| - "WebRTC.Video.BandwidthLimitedResolutionsDisabled", num_disabled, 10);
|
| + uma_prefix_ + "BandwidthLimitedResolutionsDisabled", num_disabled, 10);
|
| }
|
| int delay_ms = delay_counter_.Avg(kMinRequiredSamples);
|
| if (delay_ms != -1)
|
| - RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.SendSideDelayInMs", delay_ms);
|
| + RTC_HISTOGRAM_COUNTS_100000(uma_prefix_ + "SendSideDelayInMs", delay_ms);
|
|
|
| int max_delay_ms = max_delay_counter_.Avg(kMinRequiredSamples);
|
| if (max_delay_ms != -1) {
|
| - RTC_HISTOGRAM_COUNTS_100000(
|
| - "WebRTC.Video.SendSideDelayMaxInMs", max_delay_ms);
|
| + RTC_HISTOGRAM_COUNTS_100000(uma_prefix_ + "SendSideDelayMaxInMs",
|
| + max_delay_ms);
|
| }
|
| }
|
|
|
| @@ -240,7 +255,7 @@ void SendStatisticsProxy::OnSendEncodedImage(
|
| bw_limited_frame_counter_.Add(bw_limited);
|
| if (bw_limited) {
|
| bw_resolutions_disabled_counter_.Add(
|
| - encoded_image.adapt_reason_.bw_resolutions_disabled);
|
| + encoded_image.adapt_reason_.bw_resolutions_disabled);
|
| }
|
| }
|
|
|
| @@ -380,5 +395,4 @@ int SendStatisticsProxy::BoolSampleCounter::Fraction(
|
| return -1;
|
| return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
|
| }
|
| -
|
| } // namespace webrtc
|
|
|