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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc

Issue 2296253002: Enable BWE logging to command line when rtc_enable_bwe_test_logging is set to true (Closed)
Patch Set: adding BWE_TEST_LOGGING_COMPILE_TIME_ENABLE to gn files Created 4 years, 3 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
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/modules/rtp_rtcp/source/receive_statistics_impl.h" 11 #include "webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h"
12 12
13 #include <math.h> 13 #include <math.h>
14 14
15 #include <cstdlib> 15 #include <cstdlib>
16 16
17 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" 17 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
18 #include "webrtc/modules/rtp_rtcp/source/time_util.h" 18 #include "webrtc/modules/rtp_rtcp/source/time_util.h"
19 19
20 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h"
stefan-webrtc 2016/09/01 14:07:36 Order alphabetically (should go before rtp_rtcp)
Gaetano Carlucci 2016/09/01 16:06:26 ok
21
20 namespace webrtc { 22 namespace webrtc {
21 23
22 const int64_t kStatisticsTimeoutMs = 8000; 24 const int64_t kStatisticsTimeoutMs = 8000;
23 const int64_t kStatisticsProcessIntervalMs = 1000; 25 const int64_t kStatisticsProcessIntervalMs = 1000;
24 26
25 StreamStatistician::~StreamStatistician() {} 27 StreamStatistician::~StreamStatistician() {}
26 28
27 StreamStatisticianImpl::StreamStatisticianImpl( 29 StreamStatisticianImpl::StreamStatisticianImpl(
28 Clock* clock, 30 Clock* clock,
29 RtcpStatisticsCallback* rtcp_callback, 31 RtcpStatisticsCallback* rtcp_callback,
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 271
270 // Store this report. 272 // Store this report.
271 last_reported_statistics_ = stats; 273 last_reported_statistics_ = stats;
272 274
273 // Only for report blocks in RTCP SR and RR. 275 // Only for report blocks in RTCP SR and RR.
274 last_report_inorder_packets_ = 276 last_report_inorder_packets_ =
275 receive_counters_.transmitted.packets - 277 receive_counters_.transmitted.packets -
276 receive_counters_.retransmitted.packets; 278 receive_counters_.retransmitted.packets;
277 last_report_old_packets_ = receive_counters_.retransmitted.packets; 279 last_report_old_packets_ = receive_counters_.retransmitted.packets;
278 last_report_seq_max_ = received_seq_max_; 280 last_report_seq_max_ = received_seq_max_;
281 char str[80];
282 snprintf(str, sizeof(str), "%d cumulative_loss[pkts]", ssrc_);
283 BWE_TEST_LOGGING_PLOT(1, str, clock_->TimeInMilliseconds(), cumulative_loss_);
stefan-webrtc 2016/09/01 14:07:36 Instead of doing snprintf here I'd suggest you mak
Gaetano Carlucci 2016/09/01 16:06:26 ok
284 snprintf(str, sizeof(str), "%d received_seq_max[pkts]", ssrc_);
285 BWE_TEST_LOGGING_PLOT(1, str, clock_->TimeInMilliseconds(), \
286 (received_seq_max_ - received_seq_first_));
279 287
280 return stats; 288 return stats;
281 } 289 }
282 290
283 void StreamStatisticianImpl::GetDataCounters( 291 void StreamStatisticianImpl::GetDataCounters(
284 size_t* bytes_received, uint32_t* packets_received) const { 292 size_t* bytes_received, uint32_t* packets_received) const {
285 rtc::CritScope cs(&stream_lock_); 293 rtc::CritScope cs(&stream_lock_);
286 if (bytes_received) { 294 if (bytes_received) {
287 *bytes_received = receive_counters_.transmitted.payload_bytes + 295 *bytes_received = receive_counters_.transmitted.payload_bytes +
288 receive_counters_.transmitted.header_bytes + 296 receive_counters_.transmitted.header_bytes +
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 void NullReceiveStatistics::SetMaxReorderingThreshold( 511 void NullReceiveStatistics::SetMaxReorderingThreshold(
504 int max_reordering_threshold) {} 512 int max_reordering_threshold) {}
505 513
506 void NullReceiveStatistics::RegisterRtcpStatisticsCallback( 514 void NullReceiveStatistics::RegisterRtcpStatisticsCallback(
507 RtcpStatisticsCallback* callback) {} 515 RtcpStatisticsCallback* callback) {}
508 516
509 void NullReceiveStatistics::RegisterRtpStatisticsCallback( 517 void NullReceiveStatistics::RegisterRtpStatisticsCallback(
510 StreamDataCountersCallback* callback) {} 518 StreamDataCountersCallback* callback) {}
511 519
512 } // namespace webrtc 520 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698