Bug 1361661 - Part 1: Generate headers with process data from Processes.yaml. r=dexter
Adding the Gecko enums to Processes.yaml allows us to generate mappings from ProcessID to GeckoProcessType. We generate string tables with the Telemetry process names, so we can use these names consistently throughout Telemetry.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import re
|
||||
import yaml
|
||||
|
||||
# This is a list of flags that determine which process a measurement is allowed
|
||||
# to record from.
|
||||
@@ -130,3 +131,15 @@ def add_expiration_postfix(expiration):
|
||||
return expiration + "a1"
|
||||
|
||||
return expiration
|
||||
|
||||
|
||||
def load_yaml_file(filename):
|
||||
""" Load a YAML file from disk, throw a ParserError on failure."""
|
||||
try:
|
||||
with open(filename, 'r') as f:
|
||||
return yaml.safe_load(f)
|
||||
except IOError, e:
|
||||
raise ParserError('Error opening ' + filename + ': ' + e.message)
|
||||
except ValueError, e:
|
||||
raise ParserError('Error parsing processes in {}: {}'
|
||||
.format(filename, e.message))
|
||||
|
||||
Reference in New Issue
Block a user