def read(benchmark_result_file):
"""
Read benchmark
:param benchmark_result_file: benchmark result file
:return: {device: {metric: value, }, }
"""
result = {}
config = configparser.SafeConfigParser()
with io.open(benchmark_result_file) as fp:
config.readfp(fp) # pylint: disable=deprecated-method
for section in config.sections():
try:
device = config.get(section, _DEVICE)
result[device] = {}
for metric in Metrics:
result[device][metric.value] = config.get(
section,
metric.value
)
except configparser.NoOptionError:
_LOGGER.error(
'Incorrect section in %s',
benchmark_result_file
)
return result
评论列表
文章目录