mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +00:00
fw/output: add label property to Metric
Add a "label" property to Metric that combines its name with its classifiers into a single string.
This commit is contained in:
parent
7cd7b73f58
commit
462a5b651a
@ -497,6 +497,11 @@ A :class:`Metric` has the following attributes:
|
||||
or they may have been added by the workload to help distinguish between
|
||||
otherwise identical metrics.
|
||||
|
||||
``label``
|
||||
This is a string constructed from the name and classifiers, to provide a
|
||||
more unique identifier, e.g. for grouping values across iterations. The
|
||||
format is in the form ``name/cassifier1=value1/classifier2=value2/...``.
|
||||
|
||||
|
||||
:class:`Artifact`
|
||||
-----------------
|
||||
|
@ -602,6 +602,12 @@ class Metric(Podable):
|
||||
instance._pod_version = pod_version # pylint: disable =protected-access
|
||||
return instance
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
parts = ['{}={}'.format(n, v) for n, v in self.classifiers.items()]
|
||||
parts.insert(0, self.name)
|
||||
return '/'.join(parts)
|
||||
|
||||
def __init__(self, name, value, units=None, lower_is_better=False,
|
||||
classifiers=None):
|
||||
super(Metric, self).__init__()
|
||||
|
Loading…
x
Reference in New Issue
Block a user