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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2873303002: Add some unit tests to ReceiveStatsticsProxy. (Closed)
Patch Set: rebase Created 3 years, 7 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/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index c5fa7c004f112400e1b8e56c686cec510232e9d4..26fdae65f9cc2559298e722c45a042e53625783a 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -104,12 +104,14 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
if (fraction_lost != -1) {
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
fraction_lost);
+ LOG(LS_INFO) << "WebRTC.Video.ReceivedPacketsLostInPercent "
+ << fraction_lost;
sprang_webrtc 2017/05/11 09:17:57 Is there any way we could add func to RTC_HISTOGRA
åsapersson 2017/05/11 09:50:00 There used to be a RTC_LOGGED_* macro but it has b
sprang_webrtc 2017/05/11 10:54:58 Acknowledged.
}
}
const int kMinRequiredSamples = 200;
int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount());
- if (samples > kMinRequiredSamples) {
+ if (samples >= kMinRequiredSamples) {
RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond",
round(render_fps_tracker_.ComputeTotalRate()));
RTC_HISTOGRAM_COUNTS_100000(
@@ -121,10 +123,13 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
if (width != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width);
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height);
+ LOG(LS_INFO) << "WebRTC.Video.ReceivedWidthInPixels " << width;
+ LOG(LS_INFO) << "WebRTC.Video.ReceivedHeightInPixels " << height;
}
int sync_offset_ms = sync_offset_counter_.Avg(kMinRequiredSamples);
if (sync_offset_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms);
+ LOG(LS_INFO) << "WebRTC.Video.AVSyncOffsetInMs " << sync_offset_ms;
}
AggregatedStats freq_offset_stats = freq_offset_counter_.GetStats();
if (freq_offset_stats.num_samples > 0) {
@@ -142,30 +147,37 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
(num_key_frames * 1000 + num_total_frames / 2) / num_total_frames;
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
key_frames_permille);
+ LOG(LS_INFO) << "WebRTC.Video.KeyFramesReceivedInPermille "
+ << key_frames_permille;
}
int qp = qp_counters_.vp8.Avg(kMinRequiredSamples);
- if (qp != -1)
+ if (qp != -1) {
RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
-
+ LOG(LS_INFO) << "WebRTC.Video.Decoded.Vp8.Qp " << qp;
+ }
int decode_ms = decode_time_counter_.Avg(kMinRequiredSamples);
- if (decode_ms != -1)
+ if (decode_ms != -1) {
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
-
+ LOG(LS_INFO) << "WebRTC.Video.DecodeTimeInMs " << decode_ms;
+ }
int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredSamples);
if (jb_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
jb_delay_ms);
+ LOG(LS_INFO) << "WebRTC.Video.JitterBufferDelayInMs " << jb_delay_ms;
}
int target_delay_ms = target_delay_counter_.Avg(kMinRequiredSamples);
if (target_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms);
+ LOG(LS_INFO) << "WebRTC.Video.TargetDelayInMs " << target_delay_ms;
}
int current_delay_ms = current_delay_counter_.Avg(kMinRequiredSamples);
if (current_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
current_delay_ms);
+ LOG(LS_INFO) << "WebRTC.Video.CurrentDelayInMs " << current_delay_ms;
}
int delay_ms = delay_counter_.Avg(kMinRequiredSamples);
if (delay_ms != -1)
@@ -175,6 +187,7 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
if (e2e_delay_ms_video != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.EndToEndDelayInMs",
e2e_delay_ms_video);
+ LOG(LS_INFO) << "WebRTC.Video.EndToEndDelayInMs " << e2e_delay_ms_video;
}
int e2e_delay_ms_screenshare =
@@ -204,7 +217,7 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
rtp_rtx.Add(rtx);
int64_t elapsed_sec =
rtp_rtx.TimeSinceFirstPacketInMs(clock_->TimeInMilliseconds()) / 1000;
- if (elapsed_sec > metrics::kMinRunTimeInSeconds) {
+ if (elapsed_sec >= metrics::kMinRunTimeInSeconds) {
RTC_HISTOGRAM_COUNTS_10000(
"WebRTC.Video.BitrateReceivedInKbps",
static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
« no previous file with comments | « no previous file | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | webrtc/video/receive_statistics_proxy_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698