Load benchmark results as JSON

Load the JSON at the API side instead of client side, because that's
what the API doc says it is and it just makes more sense.
This commit is contained in:
2021-09-30 23:36:27 -04:00
parent 23977b04fc
commit ce06e4d81b
2 changed files with 7 additions and 6 deletions

View File

@ -78,6 +78,8 @@ def close_database(conn, cur, failed=False):
def list_benchmarks(job=None):
from json import loads
if job is not None:
query = "SELECT * FROM {} WHERE job = %s;".format('storage_benchmarks')
args = (job, )
@ -93,7 +95,7 @@ def list_benchmarks(job=None):
benchmark_data = dict()
benchmark_data['id'] = benchmark['id']
benchmark_data['job'] = benchmark['job']
benchmark_data['benchmark_result'] = benchmark['result']
benchmark_data['benchmark_result'] = loads(benchmark['result'])
# Append the new data to our actual output structure
data.append(benchmark_data)
close_database(conn, cur)