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

Unified Diff: webrtc/call/call.cc

Issue 2957073002: Add received audio and video call duration metrics based on packets. (Closed)
Patch Set: Add audio metric. Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call.cc
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index b4a9456d77546c02b29d6672d8873409680fc2f8..f0903cf749d2f3168ffc5254dc1ff4d05021e635 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -340,6 +340,9 @@ class Call : public webrtc::Call,
ReceiveSideCongestionController receive_side_cc_;
const std::unique_ptr<SendDelayStats> video_send_delay_stats_;
const int64_t start_ms_;
+ int64_t first_received_rtp_audio_ms_ = -1;
+ int64_t last_received_rtp_audio_ms_ = -1;
aleloi 2017/06/27 14:13:37 There is a type rtc::Optional from webrtc/base/opt
+
// TODO(perkj): |worker_queue_| is supposed to replace
// |module_process_thread_|.
// |worker_queue| is defined last to ensure all pending tasks are cancelled
@@ -530,6 +533,11 @@ void Call::UpdateSendHistograms(int64_t first_sent_packet_ms) {
}
void Call::UpdateReceiveHistograms() {
+ if (first_received_rtp_audio_ms_ != -1) {
+ RTC_HISTOGRAM_COUNTS_100000(
+ "WebRTC.Call.TimeReceivingAudioRtpPacketsInSeconds",
+ (last_received_rtp_audio_ms_ - first_received_rtp_audio_ms_) / 1000);
+ }
const int kMinRequiredPeriodicSamples = 5;
AggregatedStats video_bytes_per_sec =
received_video_bytes_per_second_counter_.GetStats();
@@ -1317,6 +1325,9 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
received_bytes_per_second_counter_.Add(static_cast<int>(length));
received_audio_bytes_per_second_counter_.Add(static_cast<int>(length));
event_log_->LogRtpHeader(kIncomingPacket, packet, length);
+ if (first_received_rtp_audio_ms_ == -1)
+ first_received_rtp_audio_ms_ = packet_time.timestamp;
aleloi 2017/06/27 14:13:37 Other places in this file use brackets for single
saza WebRTC 2017/06/29 11:49:05 Ok, I'll add them (for safety, if nothing else). T
+ last_received_rtp_audio_ms_ = packet_time.timestamp;
return DELIVERY_OK;
}
} else if (media_type == MediaType::VIDEO) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698