fix bug of finding worst result when there is no result

This commit is contained in:
yangdsh 2020-03-06 03:53:37 +00:00 committed by Dana Van Aken
parent e5e42a4ed6
commit d581703375
1 changed files with 19 additions and 18 deletions

View File

@ -487,6 +487,7 @@ def handle_result_files(session, files, execution_times=None):
# Find worst throughput
past_metrics = MetricData.objects.filter(session=session)
metric_meta = target_objectives.get_instance(session.dbms.pk, session.target_objective)
if len(past_metrics) > 0:
worst_metric = past_metrics.first()
worst_target_value = JSONUtil.loads(worst_metric.data)[session.target_objective]
for past_metric in past_metrics: