Chromium Code Reviews| 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..f9e0e057d637ef7cab461204067cf96e484927f5 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(',') |
|
Alexei Svitkine (slow)
2017/01/18 18:46:59
Note: Please also make the same change in the inte
bcwhite
2017/01/18 19:06:59
Acknowledged.
|
| + 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 ' |
|
Alexei Svitkine (slow)
2017/01/18 18:46:59
Nit: Rename this message to not say "Field Trial".
bcwhite
2017/01/18 19:06:59
Done.
|
| - 'dot separator. Histogram name is %s, and Field Trial is %s', |
| - histogram_name, histogram_suffixes_node.getAttribute('name')) |
| + 'dot separator. Histogram name is %s, Field Trial 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 |