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

Unified Diff: webrtc/call/call.cc

Issue 2979833002: Add a histogram metric tracking for how long audio RTP packets are sent (Closed)
Patch Set: Adjust for comments. Created 3 years, 5 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
« webrtc/audio/time_interval.h ('K') | « webrtc/audio/time_interval_unittest.cc ('k') | 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 0bddde9fc612739cc741b122029ea4bd54c87685..1a78d8e261c367ab72f0f232db5a57313019aa30 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -20,6 +20,7 @@
#include "webrtc/audio/audio_send_stream.h"
#include "webrtc/audio/audio_state.h"
#include "webrtc/audio/scoped_voe_interface.h"
+#include "webrtc/audio/time_interval.h"
#include "webrtc/call/bitrate_allocator.h"
#include "webrtc/call/call.h"
#include "webrtc/call/flexfec_receive_stream_impl.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_;
+ TimeInterval sent_rtp_audio_timer_ms_;
// TODO(holmer): Remove this lock once BitrateController no longer calls
// OnNetworkChanged from multiple threads.
@@ -510,6 +512,11 @@ 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(
+ "WebRTC.Call.TimeSendingAudioRtpPacketsInSeconds",
+ sent_rtp_audio_timer_ms_.Length() / 1000);
+ }
int64_t elapsed_sec =
(clock_->TimeInMilliseconds() - first_sent_packet_ms) / 1000;
if (elapsed_sec < metrics::kMinRunTimeInSeconds)
@@ -648,6 +655,7 @@ void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) {
}
}
UpdateAggregateNetworkState();
+ sent_rtp_audio_timer_ms_.Extend(audio_send_stream->GetActiveLifetime());
delete audio_send_stream;
}
« webrtc/audio/time_interval.h ('K') | « webrtc/audio/time_interval_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698