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

Side by Side Diff: ui/file_manager/file_manager/common/js/metrics_events.js

Issue 918713003: Files.app: Add analytics code to instrument cloud import flows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback. Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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 // namespace
6 var metrics = metrics || metricsBase;
7
8 /** @enum {string} */
9 metrics.Categories = {
Steve McKay 2015/02/17 23:47:51 No need for string constants. Just inline the valu
Ben Kwa 2015/02/17 23:54:24 I'd agree if this value was only used in the metri
10 IMPORT: 'Import'
11 };
12
13 /**
14 * The values of these enums come from the analytics console.
15 * @private @enum {number}
16 */
17 metrics.Dimension_ = {
18 USER_TYPE: 1,
19 SESSION_TYPE: 2,
20 DEDUPE_TYPE: 3,
Steve McKay 2015/02/17 23:47:50 Remove DEDUPE_TYPE and IMPORT_RESULT
Ben Kwa 2015/02/18 22:23:02 Done.
21 IMPORT_RESULT: 4
22 };
23
24 /**
25 * @enum {!analytics.EventBuilder.Dimension}
26 */
27 metrics.Dimensions = {
28 USER_TYPE_NON_IMPORT: {
29 index: metrics.Dimension_.USER_TYPE,
30 value: 'Non-import'
31 },
32 USER_TYPE_IMPORT: {
33 index: metrics.Dimension_.USER_TYPE,
34 value: 'Import'
35 },
36 SESSION_TYPE_NON_IMPORT: {
37 index: metrics.Dimension_.SESSION_TYPE,
38 value: 'Non-import'
39 },
40 SESSION_TYPE_IMPORT: {
41 index: metrics.Dimension_.SESSION_TYPE,
42 value: 'Import'
43 }
44 };
45
46 // namespace
47 metrics.event = metrics.event || {};
48
49 /**
50 * Base event builder for all import-related events.
51 * @private {analytics.EventBuilder}
52 */
53 metrics.event.Import_ = analytics.EventBuilder.builder()
Steve McKay 2015/02/17 23:47:50 Make this an enum: @private @enum {analytics.Eve
Ben Kwa 2015/02/18 22:23:02 Done.
54 .category(metrics.Categories.IMPORT);
Steve McKay 2015/02/17 23:47:50 IMPORT > Acquisition, because we may want to track
Ben Kwa 2015/02/18 22:23:02 Done.
55
56 /**
57 * @enum {!analytics.EventBuilder}
58 */
59 metrics.Events = {
Steve McKay 2015/02/17 23:47:50 metrics.ImportEvents, then you can remove the IMPO
Ben Kwa 2015/02/18 22:23:02 Done.
60 IMPORT_STARTED: metrics.event.Import_
61 .action('ImportStart')
Steve McKay 2015/02/17 23:47:50 Prefer regular phrases in your strings... "Import
Ben Kwa 2015/02/18 22:23:02 Done.
62 .dimension(metrics.Dimensions.SESSION_TYPE_IMPORT)
63 .dimension(metrics.Dimensions.USER_TYPE_IMPORT),
64
65 IMPORT_ENDED: metrics.event.Import_
66 .action('ImportSuccess'),
Steve McKay 2015/02/17 23:47:50 Import Completed you get the idea
Ben Kwa 2015/02/18 22:23:01 Done.
67
68 IMPORT_CANCELLED: metrics.event.Import_
69 .action('importCancelled'),
70
71 IMPORT_ERROR: metrics.event.Import_
72 .action('importError'),
73
74 IMPORT_FILE_COUNT: metrics.event.Import_
75 .action('importFileCount'),
Steve McKay 2015/02/17 23:47:50 Files Imported
Ben Kwa 2015/02/18 22:23:01 Done.
76
77 IMPORT_BYTE_COUNT: metrics.event.Import_
78 .action('importByteCount'),
Steve McKay 2015/02/17 23:47:50 Total Bytes Imported
Ben Kwa 2015/02/18 22:23:01 Done.
79
80 DEVICE_YANKED: metrics.event.Import_
81 .action('deviceYanked'),
82
83 HISTORY_DEDUPE_COUNT: metrics.event.Import_
84 .action('historyDedupeCount'),
Steve McKay 2015/02/17 23:47:50 Num. Files History Deduped Num. Files Content Dedu
Ben Kwa 2015/02/18 22:23:01 Done.
85
86 CONTENT_DEDUPE_COUNT: metrics.event.Import_
87 .action('contentDedupeCount')
88 };
89
90 // namespace
91 metrics.timing = metrics.timing || {};
92
93 /** @enum {string} */
94 metrics.timing.Variables = {
95 COMPUTE_HASH: 'ComputeHash',
Steve McKay 2015/02/17 23:47:50 Any reason we need to qualify this? We're computin
Ben Kwa 2015/02/18 22:23:01 I'll use a label.
96 SEARCH_BY_HASH: 'SearchByHash'
97 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698