ClickHouse/benchmark/generate-results.sh

24 lines
606 B
Bash
Raw Normal View History

2022-07-08 04:42:56 +00:00
#!/bin/bash -e
2022-07-04 13:12:12 +00:00
2022-07-08 05:20:45 +00:00
# This script will substitute the benchmark results into the HTML page.
# Note: editing HTML with sed may look strange, but at least we avoid using node.js and npm, and that's good.
2022-07-08 04:42:56 +00:00
(
sed '/^const data = \[$/q' index.html
FIRST=1
ls -1 */results/*.json | while read file
do
2022-07-08 07:54:06 +00:00
[ "${FIRST}" = "0" ] && echo -n ','
jq --compact-output ". += {\"source\": \"${file}\"}" "${file}"
2022-07-08 04:42:56 +00:00
FIRST=0
done
echo ']; // end of data'
sed '0,/^\]; \/\/ end of data$/d' index.html
) > index.html.new
mv index.html index.html.bak
mv index.html.new index.html