| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 cr.define('hotword.metrics', function() { |
| 6 'use strict'; |
| 7 |
| 8 /** |
| 9 * Helper function to record enum values in UMA. |
| 10 * @param {!string} name |
| 11 * @param {!number} value |
| 12 * @param {!number} maxValue |
| 13 */ |
| 14 function recordEnum(name, value, maxValue) { |
| 15 var metricDesc = { |
| 16 'metricName': name, |
| 17 'type': 'histogram-linear', |
| 18 'min': 1, |
| 19 'max': maxValue, |
| 20 'buckets': maxValue + 1 |
| 21 }; |
| 22 chrome.metricsPrivate.recordValue(metricDesc, value); |
| 23 } |
| 24 |
| 25 return { |
| 26 recordEnum: recordEnum |
| 27 }; |
| 28 }); |
| OLD | NEW |