mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-29 22:24:51 +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:
		
				
					committed by
					
						 Marc Bonnici
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							7cd7b73f58
						
					
				
				
					commit
					462a5b651a
				
			| @@ -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__() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user