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

Unified Diff: media/audio/audio_input_controller.cc

Issue 537573002: Adding Media.InputStreamDuration to UMA histograms for low-latency input audio streams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « media/audio/audio_input_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.cc
diff --git a/media/audio/audio_input_controller.cc b/media/audio/audio_input_controller.cc
index 72fb83b49ae26a4f4f57761bbda7ef449e96c801..d4ccd2eddd4bb17310c4997fdd167a30d1dc3bf7 100644
--- a/media/audio/audio_input_controller.cc
+++ b/media/audio/audio_input_controller.cc
@@ -263,6 +263,7 @@ void AudioInputController::DoCreateForLowLatency(AudioManager* audio_manager,
log_silence_state_ = true;
#endif
+ low_latency_create_time_ = base::TimeTicks::Now();
DoCreate(audio_manager, params, device_id);
}
@@ -347,8 +348,19 @@ void AudioInputController::DoClose() {
if (state_ == CLOSED)
return;
- if (handler_)
- handler_->OnLog(this, "AIC::DoClose");
+ // If this is a low-latency stream, log the total duration (since DoCreate)
+ // and add it to a UMA histogram.
+ if (!low_latency_create_time_.is_null()) {
+ base::TimeDelta duration =
+ base::TimeTicks::Now() - low_latency_create_time_;
+ UMA_HISTOGRAM_LONG_TIMES("Media.InputStreamDuration", duration);
Henrik Grunell 2014/09/04 06:32:17 I think it should be called Media.AudioInputContro
henrika (OOO until Aug 14) 2014/09/04 12:27:37 Discussed off-line. Henrik G is OK with excluding
+ if (handler_) {
+ std::ostringstream oss;
tommi (sloooow) - chröme 2014/09/03 13:50:03 use StringPrintf (stringstream should only be used
henrika (OOO until Aug 14) 2014/09/04 12:27:37 I tried to use it but was not able to come up with
henrika (OOO until Aug 14) 2014/09/04 12:54:13 Anyhow, fixed now ;-)
tommi (sloooow) - chröme 2014/09/04 16:53:21 It's because of the style guide. stringstream is
+ oss << "AIC::DoClose: stream duration="
+ << duration.InSeconds() << " seconds";
+ handler_->OnLog(this, oss.str());
+ }
+ }
// Delete the timer on the same thread that created it.
no_data_timer_.reset();
« no previous file with comments | « media/audio/audio_input_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698