From ecf3d53088c5a0a4bf3753608537f9fe7e905f98 Mon Sep 17 00:00:00 2001 From: Zijie He Date: Wed, 26 Jul 2017 15:10:02 -0700 Subject: [PATCH] Add histogram for FallbackDesktopCapturerWrapper and BlankDetectorDesktopCapturerWrapper We should record the number of fallbacks and blank frames. Bug: webrtc:8040 Change-Id: I92e7b7d7b4664fee6d6bd636609e80e532aa4bd4 Reviewed-on: https://chromium-review.googlesource.com/587688 Reviewed-by: Jamie Walch Commit-Queue: Zijie He Cr-Commit-Position: refs/heads/master@{#19161} --- .../blank_detector_desktop_capturer_wrapper.cc | 3 +++ .../desktop_capture/fallback_desktop_capturer_wrapper.cc | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc b/webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc index 13d50d5032..4f88d94b09 100644 --- a/webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc +++ b/webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc @@ -15,6 +15,7 @@ #include "webrtc/modules/desktop_capture/desktop_geometry.h" #include "webrtc/rtc_base/checks.h" +#include "webrtc/system_wrappers/include/metrics.h" namespace webrtc { @@ -78,6 +79,8 @@ void BlankDetectorDesktopCapturerWrapper::OnCaptureResult( last_frame_is_blank_ = IsBlankFrame(*frame); is_first_frame_ = false; } + RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.BlankFrameDetected", + last_frame_is_blank_); if (!last_frame_is_blank_) { non_blank_frame_received_ = true; callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); diff --git a/webrtc/modules/desktop_capture/fallback_desktop_capturer_wrapper.cc b/webrtc/modules/desktop_capture/fallback_desktop_capturer_wrapper.cc index 0fd9b8aebf..8051026ffd 100644 --- a/webrtc/modules/desktop_capture/fallback_desktop_capturer_wrapper.cc +++ b/webrtc/modules/desktop_capture/fallback_desktop_capturer_wrapper.cc @@ -13,6 +13,7 @@ #include #include "webrtc/rtc_base/checks.h" +#include "webrtc/system_wrappers/include/metrics.h" namespace webrtc { @@ -145,6 +146,10 @@ void FallbackDesktopCapturerWrapper::OnCaptureResult( Result result, std::unique_ptr frame) { RTC_DCHECK(callback_); + RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.PrimaryCapturerError", + result != Result::SUCCESS); + RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.PrimaryCapturerPermanentError", + result == Result::ERROR_PERMANENT); if (result == Result::SUCCESS) { callback_->OnCaptureResult(result, std::move(frame)); return;