1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-02 11:22:41 +01: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:
Sergei Trofimov
2019-01-14 10:21:37 +00:00
committed by Marc Bonnici
parent 7cd7b73f58
commit 462a5b651a
2 changed files with 11 additions and 0 deletions

View File

@@ -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__()