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

Side by Side Diff: tools/metrics/histograms/update_use_counter_feature_enum.py

Issue 2683333002: Add detailed use-counter stats for the prefixed quota APIs (Closed)
Patch Set: tool fix Created 3 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
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('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/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 """Scans the Chromium source of UseCounter, formats the Feature enum for 6 """Scans the Chromium source of UseCounter, formats the Feature enum for
7 histograms.xml and merges it. This script can also generate a python code 7 histograms.xml and merges it. This script can also generate a python code
8 snippet to put in uma.py of Chromium Dashboard. Make sure that you review the 8 snippet to put in uma.py of Chromium Dashboard. Make sure that you review the
9 output for correctness. 9 output for correctness.
10 """ 10 """
(...skipping 16 matching lines...) Expand all
27 parser = optparse.OptionParser() 27 parser = optparse.OptionParser()
28 parser.add_option('--for-dashboard', action='store_true', dest='dashboard', 28 parser.add_option('--for-dashboard', action='store_true', dest='dashboard',
29 default=False, 29 default=False,
30 help='Print enum definition formatted for use in uma.py of ' 30 help='Print enum definition formatted for use in uma.py of '
31 'Chromium dashboard developed at ' 31 'Chromium dashboard developed at '
32 'https://github.com/GoogleChrome/chromium-dashboard') 32 'https://github.com/GoogleChrome/chromium-dashboard')
33 options, args = parser.parse_args() 33 options, args = parser.parse_args()
34 34
35 source_path = 'third_party/WebKit/Source/core/frame/UseCounter.h' 35 source_path = 'third_party/WebKit/Source/core/frame/UseCounter.h'
36 36
37 START_MARKER = '^enum Feature {' 37 START_MARKER = '^enum Feature : uint32_t {'
38 END_MARKER = '^NumberOfFeatures' 38 END_MARKER = '^NumberOfFeatures'
39 39
40 if options.dashboard: 40 if options.dashboard:
41 enum_dict = ReadHistogramValues(source_path, START_MARKER, END_MARKER) 41 enum_dict = ReadHistogramValues(source_path, START_MARKER, END_MARKER)
42 PrintEnumForDashboard(enum_dict) 42 PrintEnumForDashboard(enum_dict)
43 else: 43 else:
44 UpdateHistogramEnum( 44 UpdateHistogramEnum(
45 histogram_enum_name='FeatureObserver', 45 histogram_enum_name='FeatureObserver',
46 source_enum_path=source_path, 46 source_enum_path=source_path,
47 start_marker=START_MARKER, 47 start_marker=START_MARKER,
48 end_marker=END_MARKER) 48 end_marker=END_MARKER)
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698