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

Unified Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp

Issue 1978403004: Add UMA histograms for WebAudio (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
index dc3afb966c3be24c02b0a5c034ddb0727f8a75d7..3edf3d77f2cfdd1270762b6d05180ddb6f60c6b8 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -35,6 +35,7 @@
#include "modules/webaudio/OfflineAudioCompletionEvent.h"
#include "modules/webaudio/OfflineAudioDestinationNode.h"
+#include "platform/Histogram.h"
#include "platform/audio/AudioUtilities.h"
namespace blink {
@@ -90,6 +91,17 @@ OfflineAudioContext* OfflineAudioContext::create(ExecutionContext* context, unsi
+ ")");
}
+ DEFINE_STATIC_LOCAL(SparseHistogram, offlineContextChannelCountHistogram,
Mark P 2016/05/23 18:10:24 SparseHistograms are slow because they acquire a l
Raymond Toy 2016/05/23 20:36:03 We don't expect many offline contexts, so speed is
Mark P 2016/05/23 21:30:24 Yes, I would encourage you to use other types when
Raymond Toy 2016/05/23 23:12:00 Unboundedness might be problem? Not really sure,
Mark P 2016/06/03 19:52:36 I'm still nervous about these being sparse histogr
+ ("WebAudio.OfflineAudioContext.ChannelCount"));
+ DEFINE_STATIC_LOCAL(SparseHistogram, offlineContextSampleRateHistogram,
+ ("WebAudio.OfflineAudioContext.SampleRate"));
+ DEFINE_STATIC_LOCAL(SparseHistogram, offlineContextLengthHistogram,
+ ("WebAudio.OfflineAudioContext.Length"));
+
+ offlineContextChannelCountHistogram.sample(numberOfChannels);
+ offlineContextSampleRateHistogram.sample(static_cast<int>(sampleRate));
+ offlineContextLengthHistogram.sample(clampTo(numberOfFrames, 0, std::numeric_limits<int>::max()));
+
audioContext->suspendIfNeeded();
return audioContext;
}

Powered by Google App Engine
This is Rietveld 408576698