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

Side by Side Diff: chrome/browser/resources/file_manager/js/metrics.js

Issue 8491038: Cleanup FileBrowser.Create.* UMA events (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Utility methods for accessing chrome.experimental.metrics API. 6 * @fileoverview Utility methods for accessing chrome.experimental.metrics API.
7 * 7 *
8 * To be included as a first script in main.html 8 * To be included as a first script in main.html
9 */ 9 */
10 10
(...skipping 18 matching lines...) Expand all
29 var elapsed = Date.now() - metrics.intervals[name]; 29 var elapsed = Date.now() - metrics.intervals[name];
30 console.log(name + ': ' + elapsed + 'ms'); 30 console.log(name + ': ' + elapsed + 'ms');
31 chrome.experimental.metrics.recordTime(metrics.convertName_(name), elapsed); 31 chrome.experimental.metrics.recordTime(metrics.convertName_(name), elapsed);
32 } else { 32 } else {
33 console.error('Unknown interval: ' + name); 33 console.error('Unknown interval: ' + name);
34 } 34 }
35 }; 35 };
36 36
37 metrics.recordAction = function(name) { 37 metrics.recordAction = function(name) {
38 chrome.experimental.metrics.recordUserAction(metrics.convertName_(name)); 38 chrome.experimental.metrics.recordUserAction(metrics.convertName_(name));
39 }; 39 };
40
41 metrics.reportCount = function(name, value) {
42 chrome.experimental.metrics.
43 recordMediumCount(metrics.convertName_(name), value);
44 };
45
46 metrics.recordEnum = function(name, value, validValues) {
47 var index = validValues.indexOf(value);
48
49 // Collect invalid values in the extra bucket at the end.
50 if (index < 0) index = validValues.length;
51
52 chrome.experimental.metrics.recordValue({
53 'metricName': metrics.convertName_(name),
54 'type': 'histogram-linear',
55 'min': 0,
56 'max': validValues.length,
57 'buckets': validValues.length + 1
58 },
59 index);
60 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | chrome/browser/resources/file_manager/js/mock_chrome.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698