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

Side by Side Diff: tools/metrics/actions/extract_actions.py

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, 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
« no previous file with comments | « tools/metrics/actions/actions.xml ('k') | tools/metrics/histograms/histograms.xml » ('j') | 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/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Extract UserMetrics "actions" strings from the Chrome source. 7 """Extract UserMetrics "actions" strings from the Chrome source.
8 8
9 This program generates the list of known actions we expect to see in the 9 This program generates the list of known actions we expect to see in the
10 user behavior logs. It walks the Chrome source, looking for calls to 10 user behavior logs. It walks the Chrome source, looking for calls to
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 # Actions sent by Chrome Connectivity Diagnostics. 401 # Actions sent by Chrome Connectivity Diagnostics.
402 actions.add('ConnectivityDiagnostics.LaunchSource.OfflineChromeOS') 402 actions.add('ConnectivityDiagnostics.LaunchSource.OfflineChromeOS')
403 actions.add('ConnectivityDiagnostics.LaunchSource.WebStore') 403 actions.add('ConnectivityDiagnostics.LaunchSource.WebStore')
404 actions.add('ConnectivityDiagnostics.UA.LogsShown') 404 actions.add('ConnectivityDiagnostics.UA.LogsShown')
405 actions.add('ConnectivityDiagnostics.UA.PassingTestsShown') 405 actions.add('ConnectivityDiagnostics.UA.PassingTestsShown')
406 actions.add('ConnectivityDiagnostics.UA.SettingsShown') 406 actions.add('ConnectivityDiagnostics.UA.SettingsShown')
407 actions.add('ConnectivityDiagnostics.UA.TestResultExpanded') 407 actions.add('ConnectivityDiagnostics.UA.TestResultExpanded')
408 actions.add('ConnectivityDiagnostics.UA.TestSuiteRun') 408 actions.add('ConnectivityDiagnostics.UA.TestSuiteRun')
409 409
410 # Actions sent by 'Ok Google' Hotwording.
411 actions.add('Hotword.HotwordTrigger')
412
410 def GrepForActions(path, actions): 413 def GrepForActions(path, actions):
411 """Grep a source file for calls to UserMetrics functions. 414 """Grep a source file for calls to UserMetrics functions.
412 415
413 Arguments: 416 Arguments:
414 path: path to the file 417 path: path to the file
415 actions: set of actions to add to 418 actions: set of actions to add to
416 """ 419 """
417 global number_of_files_total 420 global number_of_files_total
418 number_of_files_total = number_of_files_total + 1 421 number_of_files_total = number_of_files_total + 1
419 # we look for the UserMetricsAction structure constructor 422 # we look for the UserMetricsAction structure constructor
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 826
824 with open(actions_xml_path, 'wb') as f: 827 with open(actions_xml_path, 'wb') as f:
825 f.write(pretty) 828 f.write(pretty)
826 print ('Updated %s. Don\'t forget to add it to your changelist' % 829 print ('Updated %s. Don\'t forget to add it to your changelist' %
827 actions_xml_path) 830 actions_xml_path)
828 return 0 831 return 0
829 832
830 833
831 if '__main__' == __name__: 834 if '__main__' == __name__:
832 sys.exit(main(sys.argv)) 835 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « tools/metrics/actions/actions.xml ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698