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

Side by Side Diff: chrome/tools/extract_actions.py

Issue 8537008: ChromeOS should record FileBrowser.CreateNewFolder.... 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
« no previous file with comments | « chrome/tools/chromeactions.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Extract UserMetrics "actions" strings from the Chrome source. 6 """Extract UserMetrics "actions" strings from the Chrome source.
7 7
8 This program generates the list of known actions we expect to see in the 8 This program generates the list of known actions we expect to see in the
9 user behavior logs. It walks the Chrome source, looking for calls to 9 user behavior logs. It walks the Chrome source, looking for calls to
10 UserMetrics functions, extracting actions and warning on improper calls, 10 UserMetrics functions, extracting actions and warning on improper calls,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 actions.add('Accel_BrightnessDown_F6') 216 actions.add('Accel_BrightnessDown_F6')
217 actions.add('Accel_BrightnessUp_F7') 217 actions.add('Accel_BrightnessUp_F7')
218 218
219 # Actions sent by Chrome OS update engine. 219 # Actions sent by Chrome OS update engine.
220 actions.add('Updater.ServerCertificateChanged') 220 actions.add('Updater.ServerCertificateChanged')
221 actions.add('Updater.ServerCertificateFailed') 221 actions.add('Updater.ServerCertificateFailed')
222 222
223 # Actions sent by Chrome OS cryptohome. 223 # Actions sent by Chrome OS cryptohome.
224 actions.add('Cryptohome.PKCS11InitFail') 224 actions.add('Cryptohome.PKCS11InitFail')
225 225
226 # Actions sent by Chrome OS File Browser.
227 actions.add('FileBrowser.CreateNewFolder.hhaomjibdihmijegdhdafkllkbggdgoj')
Ilya Sherman 2011/11/11 23:39:20 Can this be named "FileBrowser.CreateNewFolder" in
Ilya Sherman 2011/11/11 23:39:20 Hmm, I'm confused. It looks like [1] calls metric
Vladislav Kaznacheev 2011/11/14 10:47:12 I should have mentioned one more CL (http://codere
Vladislav Kaznacheev 2011/11/14 10:47:12 My Javascript code uses chrome.experimental.metric
Ilya Sherman 2011/11/14 12:08:14 Ah, that makes more sense now. Thanks for the cla
Ilya Sherman 2011/11/14 12:08:14 Is the chrome.experimental.metrics API intended to
petkov 2011/11/14 14:03:09 jar@ should definitely take a look. I'd think that
228
226 def GrepForActions(path, actions): 229 def GrepForActions(path, actions):
227 """Grep a source file for calls to UserMetrics functions. 230 """Grep a source file for calls to UserMetrics functions.
228 231
229 Arguments: 232 Arguments:
230 path: path to the file 233 path: path to the file
231 actions: set of actions to add to 234 actions: set of actions to add to
232 """ 235 """
233 global number_of_files_total 236 global number_of_files_total
234 number_of_files_total = number_of_files_total + 1 237 number_of_files_total = number_of_files_total + 1
235 # we look for the UserMetricsAction structure constructor 238 # we look for the UserMetricsAction structure constructor
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 hash.update(action) 428 hash.update(action)
426 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action) 429 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action)
427 else: 430 else:
428 print action 431 print action
429 432
430 if hash_output: 433 if hash_output:
431 print "Done. Do not forget to add chromeactions.txt to your changelist" 434 print "Done. Do not forget to add chromeactions.txt to your changelist"
432 435
433 if '__main__' == __name__: 436 if '__main__' == __name__:
434 main(sys.argv) 437 main(sys.argv)
OLDNEW
« no previous file with comments | « chrome/tools/chromeactions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698