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

Unified Diff: tools/metrics/histograms/extract_histograms.py

Issue 2662083002: Create 'errors' histogram for failures. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/persistent_memory_allocator.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/extract_histograms.py
diff --git a/tools/metrics/histograms/extract_histograms.py b/tools/metrics/histograms/extract_histograms.py
index c8da0ccbf9f7b875af4ccd1f6bfb099bb2c5cdd5..7ed28318a99547b67481dca418df825fdbf92376 100644
--- a/tools/metrics/histograms/extract_histograms.py
+++ b/tools/metrics/histograms/extract_histograms.py
@@ -142,6 +142,12 @@ def _ExpandHistogramNameWithSuffixes(suffix_name, histogram_name,
ordering = histogram_suffixes_node.getAttribute('ordering')
else:
ordering = 'suffix'
+ parts = ordering.split(',')
+ ordering = parts[0]
+ if len(parts) > 1:
+ placement = int(parts[1])
+ else:
+ placement = 1
if ordering not in ['prefix', 'suffix']:
logging.error('ordering needs to be prefix or suffix, value is %s',
ordering)
@@ -156,15 +162,16 @@ def _ExpandHistogramNameWithSuffixes(suffix_name, histogram_name,
# For prefixes, the suffix_name is inserted between the "cluster" and the
# "remainder", e.g. Foo.BarHist expanded with gamma becomes Foo.gamma_BarHist.
sections = histogram_name.split('.')
- if len(sections) <= 1:
+ if len(sections) <= placement:
logging.error(
- 'Prefix Field Trial expansions require histogram names which include a '
- 'dot separator. Histogram name is %s, and Field Trial is %s',
- histogram_name, histogram_suffixes_node.getAttribute('name'))
+ 'Prefix histogram_suffixes expansions require histogram names which '
+ 'include a dot separator. Histogram name is %s, histogram_suffixes is '
+ '%s, and placment is %d',
+ histogram_name, histogram_suffixes_node.getAttribute('name'), placement)
raise Error()
- cluster = sections[0] + '.'
- remainder = '.'.join(sections[1:])
+ cluster = '.'.join(sections[0:placement]) + '.'
+ remainder = '.'.join(sections[placement:])
return cluster + suffix_name + separator + remainder
« no previous file with comments | « base/metrics/persistent_memory_allocator.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698