| OLD | NEW |
| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 rtc::CritScope lock(&bitrate_crit_); | 305 rtc::CritScope lock(&bitrate_crit_); |
| 306 UpdateSendHistograms(); | 306 UpdateSendHistograms(); |
| 307 } | 307 } |
| 308 UpdateReceiveHistograms(); | 308 UpdateReceiveHistograms(); |
| 309 UpdateHistograms(); | 309 UpdateHistograms(); |
| 310 | 310 |
| 311 Trace::ReturnTrace(); | 311 Trace::ReturnTrace(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void Call::UpdateHistograms() { | 314 void Call::UpdateHistograms() { |
| 315 RTC_LOGGED_HISTOGRAM_COUNTS_100000( | 315 RTC_HISTOGRAM_COUNTS_100000( |
| 316 "WebRTC.Call.LifetimeInSeconds", | 316 "WebRTC.Call.LifetimeInSeconds", |
| 317 (clock_->TimeInMilliseconds() - start_ms_) / 1000); | 317 (clock_->TimeInMilliseconds() - start_ms_) / 1000); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void Call::UpdateSendHistograms() { | 320 void Call::UpdateSendHistograms() { |
| 321 if (first_packet_sent_ms_ == -1) | 321 if (first_packet_sent_ms_ == -1) |
| 322 return; | 322 return; |
| 323 int64_t elapsed_sec = | 323 int64_t elapsed_sec = |
| 324 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000; | 324 (clock_->TimeInMilliseconds() - first_packet_sent_ms_) / 1000; |
| 325 if (elapsed_sec < metrics::kMinRunTimeInSeconds) | 325 if (elapsed_sec < metrics::kMinRunTimeInSeconds) |
| 326 return; | 326 return; |
| 327 const int kMinRequiredPeriodicSamples = 5; | 327 const int kMinRequiredPeriodicSamples = 5; |
| 328 AggregatedStats send_bitrate_stats = | 328 AggregatedStats send_bitrate_stats = |
| 329 estimated_send_bitrate_kbps_counter_.ProcessAndGetStats(); | 329 estimated_send_bitrate_kbps_counter_.ProcessAndGetStats(); |
| 330 if (send_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { | 330 if (send_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { |
| 331 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps", | 331 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps", |
| 332 send_bitrate_stats.average); | 332 send_bitrate_stats.average); |
| 333 } | 333 } |
| 334 AggregatedStats pacer_bitrate_stats = | 334 AggregatedStats pacer_bitrate_stats = |
| 335 pacer_bitrate_kbps_counter_.ProcessAndGetStats(); | 335 pacer_bitrate_kbps_counter_.ProcessAndGetStats(); |
| 336 if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { | 336 if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) { |
| 337 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", | 337 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps", |
| 338 pacer_bitrate_stats.average); | 338 pacer_bitrate_stats.average); |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 void Call::UpdateReceiveHistograms() { | 342 void Call::UpdateReceiveHistograms() { |
| 343 const int kMinRequiredPeriodicSamples = 5; | 343 const int kMinRequiredPeriodicSamples = 5; |
| 344 AggregatedStats video_bytes_per_sec = | 344 AggregatedStats video_bytes_per_sec = |
| 345 received_video_bytes_per_second_counter_.GetStats(); | 345 received_video_bytes_per_second_counter_.GetStats(); |
| 346 if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 346 if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 347 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", | 347 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps", |
| 348 video_bytes_per_sec.average * 8 / 1000); | 348 video_bytes_per_sec.average * 8 / 1000); |
| 349 } | 349 } |
| 350 AggregatedStats audio_bytes_per_sec = | 350 AggregatedStats audio_bytes_per_sec = |
| 351 received_audio_bytes_per_second_counter_.GetStats(); | 351 received_audio_bytes_per_second_counter_.GetStats(); |
| 352 if (audio_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 352 if (audio_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 353 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps", | 353 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps", |
| 354 audio_bytes_per_sec.average * 8 / 1000); | 354 audio_bytes_per_sec.average * 8 / 1000); |
| 355 } | 355 } |
| 356 AggregatedStats rtcp_bytes_per_sec = | 356 AggregatedStats rtcp_bytes_per_sec = |
| 357 received_rtcp_bytes_per_second_counter_.GetStats(); | 357 received_rtcp_bytes_per_second_counter_.GetStats(); |
| 358 if (rtcp_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 358 if (rtcp_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 359 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps", | 359 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps", |
| 360 rtcp_bytes_per_sec.average * 8); | 360 rtcp_bytes_per_sec.average * 8); |
| 361 } | 361 } |
| 362 AggregatedStats recv_bytes_per_sec = | 362 AggregatedStats recv_bytes_per_sec = |
| 363 received_bytes_per_second_counter_.GetStats(); | 363 received_bytes_per_second_counter_.GetStats(); |
| 364 if (recv_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { | 364 if (recv_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) { |
| 365 RTC_LOGGED_HISTOGRAM_COUNTS_100000("WebRTC.Call.BitrateReceivedInKbps", | 365 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.BitrateReceivedInKbps", |
| 366 recv_bytes_per_sec.average * 8 / 1000); | 366 recv_bytes_per_sec.average * 8 / 1000); |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 PacketReceiver* Call::Receiver() { | 370 PacketReceiver* Call::Receiver() { |
| 371 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 371 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
| 372 // thread. Re-enable once that is fixed. | 372 // thread. Re-enable once that is fixed. |
| 373 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 373 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 374 return this; | 374 return this; |
| 375 } | 375 } |
| 376 | 376 |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 // thread. Then this check can be enabled. | 940 // thread. Then this check can be enabled. |
| 941 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 941 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
| 942 if (RtpHeaderParser::IsRtcp(packet, length)) | 942 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 943 return DeliverRtcp(media_type, packet, length); | 943 return DeliverRtcp(media_type, packet, length); |
| 944 | 944 |
| 945 return DeliverRtp(media_type, packet, length, packet_time); | 945 return DeliverRtp(media_type, packet, length, packet_time); |
| 946 } | 946 } |
| 947 | 947 |
| 948 } // namespace internal | 948 } // namespace internal |
| 949 } // namespace webrtc | 949 } // namespace webrtc |
| OLD | NEW |