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

Side by Side Diff: tools/metrics/ukm/model.py

Issue 2870033002: Mark PageLoad UKM as singular. (Closed)
Patch Set: Mark PageLoad as singular Created 3 years, 7 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 | « no previous file | tools/metrics/ukm/ukm.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 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 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 # """Model objects for ukm.xml contents.""" 4 # """Model objects for ukm.xml contents."""
5 5
6 import os 6 import os
7 import sys 7 import sys
8 8
9 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common')) 9 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
10 import models 10 import models
(...skipping 10 matching lines...) Expand all
21 attributes=[('name', unicode)], 21 attributes=[('name', unicode)],
22 children=[ 22 children=[
23 models.ChildType('obsolete', _OBSOLETE_TYPE, False), 23 models.ChildType('obsolete', _OBSOLETE_TYPE, False),
24 models.ChildType('owners', _OWNER_TYPE, True), 24 models.ChildType('owners', _OWNER_TYPE, True),
25 models.ChildType('summary', _SUMMARY_TYPE, False), 25 models.ChildType('summary', _SUMMARY_TYPE, False),
26 ]) 26 ])
27 27
28 _EVENT_TYPE = models.ObjectNodeType( 28 _EVENT_TYPE = models.ObjectNodeType(
29 'event', 29 'event',
30 alphabetization=('metric', _LOWERCASE_NAME_FN), 30 alphabetization=('metric', _LOWERCASE_NAME_FN),
31 attributes=[('name', unicode)], 31 attributes=[('name', unicode), ('singular', bool)],
32 extra_newlines=(1, 1, 1), 32 extra_newlines=(1, 1, 1),
33 children=[ 33 children=[
34 models.ChildType('obsolete', _OBSOLETE_TYPE, False), 34 models.ChildType('obsolete', _OBSOLETE_TYPE, False),
35 models.ChildType('owners', _OWNER_TYPE, True), 35 models.ChildType('owners', _OWNER_TYPE, True),
36 models.ChildType('summary', _SUMMARY_TYPE, False), 36 models.ChildType('summary', _SUMMARY_TYPE, False),
37 models.ChildType('metrics', _METRIC_TYPE, True), 37 models.ChildType('metrics', _METRIC_TYPE, True),
38 ]) 38 ])
39 39
40 _UKM_CONFIGURATION_TYPE = models.ObjectNodeType( 40 _UKM_CONFIGURATION_TYPE = models.ObjectNodeType(
41 'ukm-configuration', 41 'ukm-configuration',
(...skipping 10 matching lines...) Expand all
52 52
53 Args: 53 Args:
54 original_xml: A string containing the original xml file contents. 54 original_xml: A string containing the original xml file contents.
55 55
56 Returns: 56 Returns:
57 A pretty-printed xml string, or None if the config contains errors. 57 A pretty-printed xml string, or None if the config contains errors.
58 """ 58 """
59 config = UKM_XML_TYPE.Parse(original_xml) 59 config = UKM_XML_TYPE.Parse(original_xml)
60 60
61 return UKM_XML_TYPE.PrettyPrint(config) 61 return UKM_XML_TYPE.PrettyPrint(config)
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/ukm/ukm.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698