Modified the front-end to display averaged results up to two decimals
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -13,14 +13,7 @@ fetchTestBenchmarkResults = (testId, benchmarkId) ->
|
||||
resultRes = await fetch("/api/v1/result/list?#{resultSearchParams}")
|
||||
resultData = await resultRes.json()
|
||||
|
||||
avg_total = 0
|
||||
min_total = 0
|
||||
max_total = 0
|
||||
|
||||
for result in resultData
|
||||
avg_total += result.avg_score
|
||||
min_total += result.min_score
|
||||
max_total += result.max_score
|
||||
resultAverage = averageResults(resultData)
|
||||
|
||||
tableRow = $("#results-table tr[data-benchmark-id=#{benchmarkId}]")
|
||||
|
||||
@@ -29,14 +22,16 @@ fetchTestBenchmarkResults = (testId, benchmarkId) ->
|
||||
tableRow.append('<td>' + resultData.length + '</td>')
|
||||
|
||||
if resultData.length != 0
|
||||
tableRow.append('<td>' + (avg_total / resultData.length) + '</td>')
|
||||
tableRow.append('<td>' + resultAverage.avgScore + '</td>')
|
||||
|
||||
if benchmarkData.scoring == 'fps'
|
||||
tableRow.append('<td>' + resultAverage.minScore + '</td>')
|
||||
tableRow.append('<td>' + resultAverage.maxScore + '</td>')
|
||||
else
|
||||
tableRow.append('<td>N/a</td>')
|
||||
tableRow.append('<td>N/a</td>')
|
||||
else
|
||||
tableRow.append('<td>N/a</td>')
|
||||
|
||||
if min_total != 0
|
||||
tableRow.append('<td>' + (min_total / resultData.length) + '</td>')
|
||||
tableRow.append('<td>' + (max_total / resultData.length) + '</td>')
|
||||
else
|
||||
tableRow.append('<td>N/a</td>')
|
||||
tableRow.append('<td>N/a</td>')
|
||||
catch error
|
||||
|
Reference in New Issue
Block a user