Index: webrtc/call/call.cc |
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc |
index 0bddde9fc612739cc741b122029ea4bd54c87685..ac3c146c4071e57c99218a3c176a683bd9aa4935 100644 |
--- a/webrtc/call/call.cc |
+++ b/webrtc/call/call.cc |
@@ -46,6 +46,7 @@ |
#include "webrtc/rtc_base/task_queue.h" |
#include "webrtc/rtc_base/thread_annotations.h" |
#include "webrtc/rtc_base/thread_checker.h" |
+#include "webrtc/rtc_base/time_interval.h" |
#include "webrtc/rtc_base/trace_event.h" |
#include "webrtc/system_wrappers/include/clock.h" |
#include "webrtc/system_wrappers/include/cpu_info.h" |
@@ -329,6 +330,7 @@ class Call : public webrtc::Call, |
rtc::Optional<int64_t> last_received_rtp_audio_ms_; |
rtc::Optional<int64_t> first_received_rtp_video_ms_; |
rtc::Optional<int64_t> last_received_rtp_video_ms_; |
+ rtc::TimeInterval sent_rtp_audio_timer_ms_; |
// TODO(holmer): Remove this lock once BitrateController no longer calls |
// OnNetworkChanged from multiple threads. |
@@ -510,6 +512,12 @@ void Call::UpdateHistograms() { |
void Call::UpdateSendHistograms(int64_t first_sent_packet_ms) { |
if (first_sent_packet_ms == -1) |
return; |
+ if (!sent_rtp_audio_timer_ms_.Empty()) { |
+ RTC_HISTOGRAM_COUNTS_100000( |
pbos-webrtc
2017/07/13 16:59:45
Is this code actually intending to track sent RTP
|
+ "WebRTC.Call.TimeSendingAudioRtpPacketsInSeconds", |
+ (*sent_rtp_audio_timer_ms_.Last() - *sent_rtp_audio_timer_ms_.First()) / |
+ 1000); |
+ } |
int64_t elapsed_sec = |
(clock_->TimeInMilliseconds() - first_sent_packet_ms) / 1000; |
if (elapsed_sec < metrics::kMinRunTimeInSeconds) |
@@ -648,6 +656,12 @@ void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { |
} |
} |
UpdateAggregateNetworkState(); |
+ const rtc::TimeInterval* stream_active_lifetime = |
+ audio_send_stream->GetActiveLifetime(); |
+ if (!stream_active_lifetime->Empty()) { |
+ sent_rtp_audio_timer_ms_.Extend(*stream_active_lifetime->First()); |
+ sent_rtp_audio_timer_ms_.Extend(*stream_active_lifetime->Last()); |
+ } |
delete audio_send_stream; |
} |