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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1366583002: Add stats for rendered pixels (sqrt(w*h)) per second: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: renamed histogram Created 5 years, 2 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/receive_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/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index b6063a80afbb1719b2c013a0881a52910da3a38d..536edc4a04742a1c5cda4114cbb0dfa52f0912e2 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -10,6 +10,9 @@
#include "webrtc/video/receive_statistics_proxy.h"
+#include <cmath>
+
+#include "webrtc/base/checks.h"
#include "webrtc/system_wrappers/interface/clock.h"
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
#include "webrtc/system_wrappers/interface/metrics.h"
@@ -21,7 +24,8 @@ ReceiveStatisticsProxy::ReceiveStatisticsProxy(uint32_t ssrc, Clock* clock)
// 1000ms window, scale 1000 for ms to s.
decode_fps_estimator_(1000, 1000),
renders_fps_estimator_(1000, 1000),
- render_fps_tracker_(100u, 10u) {
+ render_fps_tracker_(100u, 10u),
+ render_pixel_tracker_(100u, 10u) {
stats_.ssrc = ssrc;
}
@@ -35,12 +39,14 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
fraction_lost);
}
-
- int render_fps = static_cast<int>(render_fps_tracker_.ComputeTotalRate());
- if (render_fps > 0)
- RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", render_fps);
-
const int kMinRequiredSamples = 200;
+ int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount());
+ if (samples > kMinRequiredSamples) {
+ RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond",
+ static_cast<int>(render_fps_tracker_.ComputeTotalRate()));
+ RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.RenderSqrtPixelsPerSecond",
+ static_cast<int>(render_pixel_tracker_.ComputeTotalRate()));
+ }
int width = render_width_counter_.Avg(kMinRequiredSamples);
int height = render_height_counter_.Avg(kMinRequiredSamples);
if (width != -1) {
@@ -138,6 +144,8 @@ void ReceiveStatisticsProxy::OnDecodedFrame() {
}
void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
+ RTC_DCHECK_GT(width, 0);
+ RTC_DCHECK_GT(height, 0);
uint64_t now = clock_->TimeInMilliseconds();
rtc::CritScope lock(&crit_);
@@ -146,6 +154,7 @@ void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
render_width_counter_.Add(width);
render_height_counter_.Add(height);
render_fps_tracker_.AddSamples(1);
+ render_pixel_tracker_.AddSamples(sqrt(width * height));
}
void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate,
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698