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

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 incorrect log for message timeout. 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..6adccb4a234f10a17a9418c72cc3fb5870d6b4e0
--- /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} maxValue
+ */
+ function recordEnum(name, value, maxValue) {
+ var metricDesc = {
+ 'metricName': name,
+ 'type': 'histogram-linear',
+ 'min': 1,
+ 'max': maxValue,
+ 'buckets': maxValue + 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