mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 10:11:17 +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 = {
|
UNITS = {
|
||||||
|
'energy': 'Joules',
|
||||||
'power': 'Watts',
|
'power': 'Watts',
|
||||||
'voltage': 'Volts',
|
'voltage': 'Volts',
|
||||||
}
|
}
|
||||||
@ -165,6 +166,8 @@ class Daq(Instrument):
|
|||||||
metric_name = '{}_{}'.format(port, metric)
|
metric_name = '{}_{}'.format(port, metric)
|
||||||
context.result.add_metric(metric_name, round(value, 3), UNITS[metric])
|
context.result.add_metric(metric_name, round(value, 3), UNITS[metric])
|
||||||
self._results[key][metric_name] = round(value, 3)
|
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):
|
def teardown(self, context):
|
||||||
self.logger.debug('Terminating session.')
|
self.logger.debug('Terminating session.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user