mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 00:52:08 +00:00 
			
		
		
		
	daq instrument updated to report energy.
This commit is contained in:
		@@ -39,6 +39,7 @@ sys.path.pop(0)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
UNITS = {
 | 
			
		||||
    'energy': 'Joules',
 | 
			
		||||
    'power': 'Watts',
 | 
			
		||||
    'voltage': 'Volts',
 | 
			
		||||
}
 | 
			
		||||
@@ -165,6 +166,8 @@ class Daq(Instrument):
 | 
			
		||||
                    metric_name = '{}_{}'.format(port, metric)
 | 
			
		||||
                    context.result.add_metric(metric_name, round(value, 3), UNITS[metric])
 | 
			
		||||
                    self._results[key][metric_name] = round(value, 3)
 | 
			
		||||
                energy = sum(data[metrics.index('power')]) * (self.sampling_rate / 1000000)
 | 
			
		||||
                context.result.add_metric('{}_energy'.format(port), round(energy, 3), UNITS['energy'])
 | 
			
		||||
 | 
			
		||||
    def teardown(self, context):
 | 
			
		||||
        self.logger.debug('Terminating session.')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user