mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 20:38:57 +00:00
Allow setting classifiers via agenda.
This commit is contained in:
parent
aa2ae03ce6
commit
25c0fd7b8b
@ -70,6 +70,7 @@ class AgendaWorkloadEntry(AgendaEntry):
|
|||||||
default=OrderedDict())
|
default=OrderedDict())
|
||||||
self.instrumentation = kwargs.pop('instrumentation', [])
|
self.instrumentation = kwargs.pop('instrumentation', [])
|
||||||
self.flash = kwargs.pop('flash', OrderedDict())
|
self.flash = kwargs.pop('flash', OrderedDict())
|
||||||
|
self.classifiers = kwargs.pop('classifiers', OrderedDict())
|
||||||
if kwargs:
|
if kwargs:
|
||||||
raise ConfigError('Invalid entry(ies) in workload {}: {}'.format(self.id, ', '.join(kwargs.keys())))
|
raise ConfigError('Invalid entry(ies) in workload {}: {}'.format(self.id, ', '.join(kwargs.keys())))
|
||||||
|
|
||||||
@ -96,6 +97,7 @@ class AgendaSectionEntry(AgendaEntry):
|
|||||||
default=OrderedDict())
|
default=OrderedDict())
|
||||||
self.instrumentation = kwargs.pop('instrumentation', [])
|
self.instrumentation = kwargs.pop('instrumentation', [])
|
||||||
self.flash = kwargs.pop('flash', OrderedDict())
|
self.flash = kwargs.pop('flash', OrderedDict())
|
||||||
|
self.classifiers = kwargs.pop('classifiers', OrderedDict())
|
||||||
self.workloads = []
|
self.workloads = []
|
||||||
for w in kwargs.pop('workloads', []):
|
for w in kwargs.pop('workloads', []):
|
||||||
self.workloads.append(agenda.get_workload_entry(w))
|
self.workloads.append(agenda.get_workload_entry(w))
|
||||||
@ -128,6 +130,7 @@ class AgendaGlobalEntry(AgendaEntry):
|
|||||||
default=OrderedDict())
|
default=OrderedDict())
|
||||||
self.instrumentation = kwargs.pop('instrumentation', [])
|
self.instrumentation = kwargs.pop('instrumentation', [])
|
||||||
self.flash = kwargs.pop('flash', OrderedDict())
|
self.flash = kwargs.pop('flash', OrderedDict())
|
||||||
|
self.classifiers = kwargs.pop('classifiers', OrderedDict())
|
||||||
if kwargs:
|
if kwargs:
|
||||||
raise ConfigError('Invalid entries in global section: {}'.format(kwargs))
|
raise ConfigError('Invalid entries in global section: {}'.format(kwargs))
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ class WorkloadRunSpec(object):
|
|||||||
runtime_parameters=None,
|
runtime_parameters=None,
|
||||||
instrumentation=None,
|
instrumentation=None,
|
||||||
flash=None,
|
flash=None,
|
||||||
|
classifiers=None,
|
||||||
): # pylint: disable=W0622
|
): # pylint: disable=W0622
|
||||||
self.id = id
|
self.id = id
|
||||||
self.number_of_iterations = number_of_iterations
|
self.number_of_iterations = number_of_iterations
|
||||||
@ -88,6 +89,7 @@ class WorkloadRunSpec(object):
|
|||||||
self.workload_parameters = workload_parameters or OrderedDict()
|
self.workload_parameters = workload_parameters or OrderedDict()
|
||||||
self.instrumentation = instrumentation or []
|
self.instrumentation = instrumentation or []
|
||||||
self.flash = flash or OrderedDict()
|
self.flash = flash or OrderedDict()
|
||||||
|
self.classifiers = classifiers or OrderedDict()
|
||||||
self._workload = None
|
self._workload = None
|
||||||
self._section = None
|
self._section = None
|
||||||
self.enabled = True
|
self.enabled = True
|
||||||
@ -96,7 +98,7 @@ class WorkloadRunSpec(object):
|
|||||||
if param in ['id', 'section_id', 'number_of_iterations', 'workload_name', 'label']:
|
if param in ['id', 'section_id', 'number_of_iterations', 'workload_name', 'label']:
|
||||||
if value is not None:
|
if value is not None:
|
||||||
setattr(self, param, value)
|
setattr(self, param, value)
|
||||||
elif param in ['boot_parameters', 'runtime_parameters', 'workload_parameters', 'flash']:
|
elif param in ['boot_parameters', 'runtime_parameters', 'workload_parameters', 'flash', 'classifiers']:
|
||||||
setattr(self, param, merge_dicts(getattr(self, param), value, list_duplicates='last',
|
setattr(self, param, merge_dicts(getattr(self, param), value, list_duplicates='last',
|
||||||
dict_type=OrderedDict, should_normalize=False))
|
dict_type=OrderedDict, should_normalize=False))
|
||||||
elif param in ['instrumentation']:
|
elif param in ['instrumentation']:
|
||||||
@ -167,6 +169,7 @@ class WorkloadRunSpec(object):
|
|||||||
other.workload_parameters = copy(self.workload_parameters)
|
other.workload_parameters = copy(self.workload_parameters)
|
||||||
other.instrumentation = copy(self.instrumentation)
|
other.instrumentation = copy(self.instrumentation)
|
||||||
other.flash = copy(self.flash)
|
other.flash = copy(self.flash)
|
||||||
|
other.classifiers = copy(self.classifiers)
|
||||||
other._section = self._section # pylint: disable=protected-access
|
other._section = self._section # pylint: disable=protected-access
|
||||||
other.enabled = self.enabled
|
other.enabled = self.enabled
|
||||||
return other
|
return other
|
||||||
@ -492,6 +495,7 @@ class RunConfiguration(object):
|
|||||||
RunConfigurationItem('runtime_parameters', 'dict', 'merge'),
|
RunConfigurationItem('runtime_parameters', 'dict', 'merge'),
|
||||||
RunConfigurationItem('instrumentation', 'list', 'merge'),
|
RunConfigurationItem('instrumentation', 'list', 'merge'),
|
||||||
RunConfigurationItem('flash', 'dict', 'merge'),
|
RunConfigurationItem('flash', 'dict', 'merge'),
|
||||||
|
RunConfigurationItem('classifiers', 'dict', 'merge'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# List of names that may be present in configuration (and it is valid for
|
# List of names that may be present in configuration (and it is valid for
|
||||||
|
@ -254,13 +254,13 @@ class IterationResult(object):
|
|||||||
self.spec = spec
|
self.spec = spec
|
||||||
self.id = spec.id
|
self.id = spec.id
|
||||||
self.workload = spec.workload
|
self.workload = spec.workload
|
||||||
|
self.classifiers = copy(spec.classifiers)
|
||||||
self.iteration = None
|
self.iteration = None
|
||||||
self.status = self.NOT_STARTED
|
self.status = self.NOT_STARTED
|
||||||
self.output_directory = None
|
self.output_directory = None
|
||||||
self.events = []
|
self.events = []
|
||||||
self.metrics = []
|
self.metrics = []
|
||||||
self.artifacts = []
|
self.artifacts = []
|
||||||
self.classifiers = {}
|
|
||||||
|
|
||||||
def add_metric(self, name, value, units=None, lower_is_better=False, classifiers=None):
|
def add_metric(self, name, value, units=None, lower_is_better=False, classifiers=None):
|
||||||
classifiers = merge_dicts(self.classifiers, classifiers or {},
|
classifiers = merge_dicts(self.classifiers, classifiers or {},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user