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

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
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c6f48e21a853a3b254a6eb0c92a43f39c04af930 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 {
@@ -23,11 +24,24 @@ const int SendStatisticsProxy::kStatsTimeoutMs = 5000;
SendStatisticsProxy::SendStatisticsProxy(Clock* clock,
const VideoSendStream::Config& config)
- : clock_(clock),
- config_(config) {
+ : clock_(clock), config_(config), last_sent_frame_timestamp_(0) {
}
-SendStatisticsProxy::~SendStatisticsProxy() {}
+SendStatisticsProxy::~SendStatisticsProxy() {
+ UpdateHistograms();
+}
+
+void SendStatisticsProxy::UpdateHistograms() {
+ int input_fps =
+ static_cast<int>(input_frame_rate_tracker_total_.units_second());
+ int sent_fps =
+ static_cast<int>(sent_frame_rate_tracker_total_.units_second());
+
+ if (input_fps > 0)
+ RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.InputFramesPerSecond", input_fps);
+ if (sent_fps > 0)
+ RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps);
+}
void SendStatisticsProxy::OutgoingRate(const int video_channel,
const unsigned int framerate,
@@ -125,11 +139,16 @@ void SendStatisticsProxy::OnSendEncodedImage(
stats->width = encoded_image._encodedWidth;
stats->height = encoded_image._encodedHeight;
update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds();
+ if (encoded_image._timeStamp != last_sent_frame_timestamp_) {
+ last_sent_frame_timestamp_ = encoded_image._timeStamp;
+ sent_frame_rate_tracker_total_.Update(1);
+ }
}
void SendStatisticsProxy::OnIncomingFrame() {
rtc::CritScope lock(&crit_);
input_frame_rate_tracker_.Update(1);
+ input_frame_rate_tracker_total_.Update(1);
}
void SendStatisticsProxy::RtcpPacketTypesCounterUpdated(
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698