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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1169543005: Add sent framerates to histogram stats: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 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 a6cb5b38e6bddd3d312f8c9b3d455acee9103cf6..c5e9bef6abf76312a9816ce06e6d419722a505d9 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -16,6 +16,7 @@
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
#include "webrtc/system_wrappers/interface/logging.h"
+#include "webrtc/system_wrappers/interface/metrics.h"
namespace webrtc {
@@ -27,7 +28,20 @@ SendStatisticsProxy::SendStatisticsProxy(Clock* clock,
config_(config) {
}
-SendStatisticsProxy::~SendStatisticsProxy() {}
+SendStatisticsProxy::~SendStatisticsProxy() {
+ UpdateHistograms();
+}
+
+void SendStatisticsProxy::UpdateHistograms() {
+ int fps;
+ {
+ rtc::CritScope lock(&crit_);
+ fps = static_cast<int>(input_frame_rate_tracker_total_.units_second());
+ }
+ if (fps > 0) {
+ RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.InputFramesPerSecond", fps);
+ }
+}
void SendStatisticsProxy::OutgoingRate(const int video_channel,
const unsigned int framerate,
@@ -130,6 +144,7 @@ void SendStatisticsProxy::OnSendEncodedImage(
void SendStatisticsProxy::OnIncomingFrame() {
rtc::CritScope lock(&crit_);
input_frame_rate_tracker_.Update(1);
+ input_frame_rate_tracker_total_.Update(1);
}
void SendStatisticsProxy::RtcpPacketTypesCounterUpdated(

Powered by Google App Engine
This is Rietveld 408576698