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

Side by Side Diff: webrtc/call/call.cc

Issue 1788783002: Add macros for ability to log samples that are added to histograms (RTC_LOGGED_*). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc » ('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
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 if (num_bitrate_updates_ == 0 || first_packet_sent_ms_ == -1) 261 if (num_bitrate_updates_ == 0 || first_packet_sent_ms_ == -1)
262 return; 262 return;
263 int64_t elapsed_sec = 263 int64_t elapsed_sec =
264 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000; 264 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000;
265 if (elapsed_sec < metrics::kMinRunTimeInSeconds) 265 if (elapsed_sec < metrics::kMinRunTimeInSeconds)
266 return; 266 return;
267 int send_bitrate_kbps = 267 int send_bitrate_kbps =
268 estimated_send_bitrate_sum_kbits_ / num_bitrate_updates_; 268 estimated_send_bitrate_sum_kbits_ / num_bitrate_updates_;
269 int pacer_bitrate_kbps = pacer_bitrate_sum_kbits_ / num_bitrate_updates_; 269 int pacer_bitrate_kbps = pacer_bitrate_sum_kbits_ / num_bitrate_updates_;
270 if (send_bitrate_kbps > 0) { 270 if (send_bitrate_kbps > 0) {
271 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps", 271 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps",
272 send_bitrate_kbps); 272 send_bitrate_kbps);
273 } 273 }
274 if (pacer_bitrate_kbps > 0) { 274 if (pacer_bitrate_kbps > 0) {
275 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", 275 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps",
276 pacer_bitrate_kbps); 276 pacer_bitrate_kbps);
277 } 277 }
278 } 278 }
279 279
280 void Call::UpdateReceiveHistograms() { 280 void Call::UpdateReceiveHistograms() {
281 if (first_rtp_packet_received_ms_ == -1) 281 if (first_rtp_packet_received_ms_ == -1)
282 return; 282 return;
283 int64_t elapsed_sec = 283 int64_t elapsed_sec =
284 (last_rtp_packet_received_ms_ - first_rtp_packet_received_ms_) / 1000; 284 (last_rtp_packet_received_ms_ - first_rtp_packet_received_ms_) / 1000;
285 if (elapsed_sec < metrics::kMinRunTimeInSeconds) 285 if (elapsed_sec < metrics::kMinRunTimeInSeconds)
286 return; 286 return;
287 int audio_bitrate_kbps = received_audio_bytes_ * 8 / elapsed_sec / 1000; 287 int audio_bitrate_kbps = received_audio_bytes_ * 8 / elapsed_sec / 1000;
288 int video_bitrate_kbps = received_video_bytes_ * 8 / elapsed_sec / 1000; 288 int video_bitrate_kbps = received_video_bytes_ * 8 / elapsed_sec / 1000;
289 int rtcp_bitrate_bps = received_rtcp_bytes_ * 8 / elapsed_sec; 289 int rtcp_bitrate_bps = received_rtcp_bytes_ * 8 / elapsed_sec;
290 if (video_bitrate_kbps > 0) { 290 if (video_bitrate_kbps > 0) {
291 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", 291 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps",
292 video_bitrate_kbps); 292 video_bitrate_kbps);
293 } 293 }
294 if (audio_bitrate_kbps > 0) { 294 if (audio_bitrate_kbps > 0) {
295 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps", 295 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps",
296 audio_bitrate_kbps); 296 audio_bitrate_kbps);
297 } 297 }
298 if (rtcp_bitrate_bps > 0) { 298 if (rtcp_bitrate_bps > 0) {
299 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps", 299 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps",
300 rtcp_bitrate_bps); 300 rtcp_bitrate_bps);
301 } 301 }
302 RTC_HISTOGRAM_COUNTS_100000( 302 RTC_LOGGED_HISTOGRAM_COUNTS_100000(
303 "WebRTC.Call.BitrateReceivedInKbps", 303 "WebRTC.Call.BitrateReceivedInKbps",
304 audio_bitrate_kbps + video_bitrate_kbps + rtcp_bitrate_bps / 1000); 304 audio_bitrate_kbps + video_bitrate_kbps + rtcp_bitrate_bps / 1000);
305 } 305 }
306 306
307 PacketReceiver* Call::Receiver() { 307 PacketReceiver* Call::Receiver() {
308 // TODO(solenberg): Some test cases in EndToEndTest use this from a different 308 // TODO(solenberg): Some test cases in EndToEndTest use this from a different
309 // thread. Re-enable once that is fixed. 309 // thread. Re-enable once that is fixed.
310 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); 310 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread());
311 return this; 311 return this;
312 } 312 }
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 // thread. Then this check can be enabled. 745 // thread. Then this check can be enabled.
746 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); 746 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread());
747 if (RtpHeaderParser::IsRtcp(packet, length)) 747 if (RtpHeaderParser::IsRtcp(packet, length))
748 return DeliverRtcp(media_type, packet, length); 748 return DeliverRtcp(media_type, packet, length);
749 749
750 return DeliverRtp(media_type, packet, length, packet_time); 750 return DeliverRtp(media_type, packet, length, packet_time);
751 } 751 }
752 752
753 } // namespace internal 753 } // namespace internal
754 } // namespace webrtc 754 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698