mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
daq instrument updated to report energy.
This commit is contained in:
parent
62593987f4
commit
958a8a09da
@ -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.')
|
||||
|
Loading…
x
Reference in New Issue
Block a user