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

Side by Side Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2136533002: Only update codec type histogram if lifetime is long enough (10 sec). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/video/receive_statistics_proxy.h" 11 #include "webrtc/video/receive_statistics_proxy.h"
12 12
13 #include <cmath> 13 #include <cmath>
14 14
15 #include "webrtc/base/checks.h" 15 #include "webrtc/base/checks.h"
16 #include "webrtc/modules/video_coding/include/video_codec_interface.h" 16 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
17 #include "webrtc/system_wrappers/include/clock.h" 17 #include "webrtc/system_wrappers/include/clock.h"
18 #include "webrtc/system_wrappers/include/metrics.h" 18 #include "webrtc/system_wrappers/include/metrics.h"
19 19
20 namespace webrtc { 20 namespace webrtc {
21 21
22 ReceiveStatisticsProxy::ReceiveStatisticsProxy( 22 ReceiveStatisticsProxy::ReceiveStatisticsProxy(
23 const VideoReceiveStream::Config* config, 23 const VideoReceiveStream::Config* config,
24 Clock* clock) 24 Clock* clock)
25 : clock_(clock), 25 : clock_(clock),
26 config_(*config), 26 config_(*config),
27 start_ms_(clock->TimeInMilliseconds()),
27 // 1000ms window, scale 1000 for ms to s. 28 // 1000ms window, scale 1000 for ms to s.
28 decode_fps_estimator_(1000, 1000), 29 decode_fps_estimator_(1000, 1000),
29 renders_fps_estimator_(1000, 1000), 30 renders_fps_estimator_(1000, 1000),
30 render_fps_tracker_(100, 10u), 31 render_fps_tracker_(100, 10u),
31 render_pixel_tracker_(100, 10u) { 32 render_pixel_tracker_(100, 10u) {
32 stats_.ssrc = config_.rtp.remote_ssrc; 33 stats_.ssrc = config_.rtp.remote_ssrc;
33 for (auto it : config_.rtp.rtx) 34 for (auto it : config_.rtp.rtx)
34 rtx_stats_[it.second.ssrc] = StreamDataCounters(); 35 rtx_stats_[it.second.ssrc] = StreamDataCounters();
35 } 36 }
36 37
37 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { 38 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() {
38 UpdateHistograms(); 39 UpdateHistograms();
39 } 40 }
40 41
41 void ReceiveStatisticsProxy::UpdateHistograms() { 42 void ReceiveStatisticsProxy::UpdateHistograms() {
43 RTC_LOGGED_HISTOGRAM_COUNTS_100000(
44 "WebRTC.Video.ReceiveStreamLifetimeInSeconds",
45 (clock_->TimeInMilliseconds() - start_ms_) / 1000);
46
42 int fraction_lost = report_block_stats_.FractionLostInPercent(); 47 int fraction_lost = report_block_stats_.FractionLostInPercent();
43 if (fraction_lost != -1) { 48 if (fraction_lost != -1) {
44 RTC_LOGGED_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent", 49 RTC_LOGGED_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
45 fraction_lost); 50 fraction_lost);
46 } 51 }
47 const int kMinRequiredSamples = 200; 52 const int kMinRequiredSamples = 200;
48 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount()); 53 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount());
49 if (samples > kMinRequiredSamples) { 54 if (samples > kMinRequiredSamples) {
50 RTC_LOGGED_HISTOGRAM_COUNTS_100( 55 RTC_LOGGED_HISTOGRAM_COUNTS_100(
51 "WebRTC.Video.RenderFramesPerSecond", 56 "WebRTC.Video.RenderFramesPerSecond",
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 ++num_samples; 306 ++num_samples;
302 } 307 }
303 308
304 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { 309 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
305 if (num_samples < min_required_samples || num_samples == 0) 310 if (num_samples < min_required_samples || num_samples == 0)
306 return -1; 311 return -1;
307 return sum / num_samples; 312 return sum / num_samples;
308 } 313 }
309 314
310 } // namespace webrtc 315 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698