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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1250203002: Add encode and decode time to histograms stats: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: added todo Created 5 years, 5 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') | webrtc/video/video_capture_input.cc » ('j') | 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 fe60f1eaa5f9937441a9fbfc289d868109a0b18c..551b4b562a43904f6cfe1105d65455b2610126b9 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -46,7 +46,7 @@ void SendStatisticsProxy::UpdateHistograms() {
if (sent_fps > 0)
RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps);
- const int kMinRequiredSamples = 100;
+ const int kMinRequiredSamples = 200;
int in_width = input_width_counter_.Avg(kMinRequiredSamples);
int in_height = input_height_counter_.Avg(kMinRequiredSamples);
if (in_width != -1) {
@@ -59,6 +59,9 @@ void SendStatisticsProxy::UpdateHistograms() {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentWidthInPixels", sent_width);
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentHeightInPixels", sent_height);
}
+ int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples);
+ if (encode_ms != -1)
+ RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms);
}
void SendStatisticsProxy::OutgoingRate(const int video_channel,
@@ -72,6 +75,7 @@ void SendStatisticsProxy::OutgoingRate(const int video_channel,
void SendStatisticsProxy::CpuOveruseMetricsUpdated(
const CpuOveruseMetrics& metrics) {
rtc::CritScope lock(&crit_);
+ // TODO(asapersson): Change to use OnEncodedFrame() for avg_encode_time_ms.
stats_.avg_encode_time_ms = metrics.avg_encode_time_ms;
stats_.encode_usage_percent = metrics.encode_usage_percent;
}
@@ -186,6 +190,11 @@ void SendStatisticsProxy::OnIncomingFrame(int width, int height) {
input_height_counter_.Add(height);
}
+void SendStatisticsProxy::OnEncodedFrame(int encode_time_ms) {
+ rtc::CritScope lock(&crit_);
+ encode_time_counter_.Add(encode_time_ms);
+}
+
void SendStatisticsProxy::RtcpPacketTypesCounterUpdated(
uint32_t ssrc,
const RtcpPacketTypeCounter& packet_counter) {
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/video_capture_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698