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( |