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

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

Issue 1927313002: Add histogram for IIRFilter orders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 8 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
index 0cf20480324d354b2f7beddd9f74b94e074f3051..401e199f33e63739b32b39c644269c57ca624921 100644
--- a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
@@ -8,6 +8,7 @@
#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "modules/webaudio/AudioBasicProcessorHandler.h"
+#include "platform/Histogram.h"
namespace blink {
@@ -17,6 +18,13 @@ IIRFilterNode::IIRFilterNode(AbstractAudioContext& context, float sampleRate, co
setHandler(AudioBasicProcessorHandler::create(
AudioHandler::NodeTypeIIRFilter, *this, sampleRate,
adoptPtr(new IIRProcessor(sampleRate, 1, feedforwardCoef, feedbackCoef))));
+
+ // Histogram of the IIRFilter order. createIIRFilter ensures that the length of |feedbackCoef|
+ // is in the range [1, IIRFilter::kMaxOrder + 1]. The order is one less than the length of this
+ // vector.
+ DEFINE_STATIC_LOCAL(SparseHistogram, filterOrderHistogram, ("WebAudio.IIRFilterNode.Order"));
+
+ filterOrderHistogram.sample(feedbackCoef.size() - 1);
}
DEFINE_TRACE(IIRFilterNode)
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698