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

Unified Diff: chrome/browser/resources/hotword/metrics.js

Issue 667873002: Add UMA to hotword trigger extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove invalid user action. Created 6 years, 2 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 | « chrome/browser/resources/hotword/manifest.json ('k') | chrome/browser/resources/hotword/nacl_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hotword/metrics.js
diff --git a/chrome/browser/resources/hotword/metrics.js b/chrome/browser/resources/hotword/metrics.js
new file mode 100644
index 0000000000000000000000000000000000000000..573dce413329db8c5f603da3594a9e63760243b6
--- /dev/null
+++ b/chrome/browser/resources/hotword/metrics.js
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('hotword.metrics', function() {
+ 'use strict';
+
+ /**
+ * Helper function to record enum values in UMA.
+ * @param {!string} name
+ * @param {!number} value
+ * @param {!number} max_value
+ */
+ function recordEnum(name, value, max_value) {
Dan Beam 2014/10/21 01:57:29 maxValue
Anand Mistry (off Chromium) 2014/10/21 05:26:41 Done.
+ var metricDesc = {
+ 'metricName': name,
+ 'type': 'histogram-linear',
+ 'min': 1,
+ 'max': max_value,
+ 'buckets': max_value + 1
+ };
+ chrome.metricsPrivate.recordValue(metricDesc, value);
+ }
+
+ return {
+ recordEnum: recordEnum
+ };
+});
« no previous file with comments | « chrome/browser/resources/hotword/manifest.json ('k') | chrome/browser/resources/hotword/nacl_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698