summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Alfonsi <laurent.alfonsi@linaro.org>2022-09-16 19:03:58 +0200
committerLaurent Alfonsi <laurent.alfonsi@linaro.org>2022-09-20 20:38:41 +0000
commit562d5ea9db62a96c6ba5b4437c79ee642e2a09f5 (patch)
treeba6b06cb63c01450b99c65021a5ba8c55cf7607b
parent7064b75df6f8a3ad99e7efcffd59c09c382cfd66 (diff)
dashboard-generate-squad.sh: Fix metric dump
Change-Id: Ic98595a40e09bb873076c2d128c75f800c878a2b
-rwxr-xr-xdashboard-generate-squad.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/dashboard-generate-squad.sh b/dashboard-generate-squad.sh
index eacbd764..65c329f8 100755
--- a/dashboard-generate-squad.sh
+++ b/dashboard-generate-squad.sh
@@ -159,7 +159,6 @@ create_dashboard_files()
# echo " - writing $squaddir/$bench # ${project_results["func/*/$bench"]}"
mkdir -p $squaddir/$bench
-
# results-functional.json : for now, only @func_fields=(build run)
resfile=$squaddir/$bench/results-functional.json
echo "{" > "$resfile"
@@ -170,17 +169,19 @@ create_dashboard_files()
echo "}" >> "$resfile"
# results-metrics.json : @metric_fields=(perf size vect) / (score)
+ local comma=","
+ local metrics_to_show=()
+
resfile=$squaddir/$bench/results-metrics.json
echo "{" > "$resfile"
- if [ "${metric_fields[*]}" == "perf size vect" ]; then
- [ -v project_results["metrics/perf/$bench"] ] && echo " \"perf\" : \"${project_results["metrics/perf/$bench"]}\"," >>"$resfile"
- [ -v project_results["metrics/size/$bench"] ] && echo " \"size\" : \"${project_results["metrics/size/$bench"]}\"," >>"$resfile"
- [ -v project_results["metrics/vect/$bench"] ] && echo " \"vect\" : \"${project_results["metrics/vect/$bench"]}\"" >>"$resfile"
- elif [ "${metric_fields[*]}" == "score" ]; then
- [ -v project_results["metrics/score/test"] ] && echo " \"score\" : \"${project_results["metrics/score/test"]}\"" >>"$resfile"
- fi
+ for metric in "${metric_fields[@]}"; do
+ [ -v project_results["metrics/$metric/$bench"] ] && metrics_to_show+=("$metric")
+ done
+ for metric in "${metrics_to_show[@]}"; do
+ [ $metric == ${metrics_to_show[-1]} ] && comma=""
+ echo " \"$metric\" : \"${project_results["metrics/$metric/$bench"]}\"$comma" >>"$resfile"
+ done
echo "}" >> "$resfile"
-
# results-metadata.json
resfile=$squaddir/$bench/results-metadata.json
local base_artifacts_url=https://git-us.linaro.org/toolchain/ci/base-artifacts.git