improve the comparison script

This commit is contained in:
Irevoire 2021-09-16 11:25:51 +02:00
parent 3b1885859d
commit f6c6b026bb
No known key found for this signature in database
GPG Key ID: 7A6A970C96104F1B

View File

@ -17,21 +17,9 @@ if [[ "$?" -ne 0 ]]; then
exit 1 exit 1
fi fi
if [[ $# -ne 2 ]]
then
echo 'Need 2 arguments.'
echo 'Usage: '
echo ' $ ./compare.sh old new'
echo 'Ex:'
echo ' $ ./compare.sh songs_main_09a4321.json songs_geosearch_24ec456.json'
exit 1
fi
old_file="$1"
new_file="$2"
s3_url='https://milli-benchmarks.fra1.digitaloceanspaces.com/critcmp_results' s3_url='https://milli-benchmarks.fra1.digitaloceanspaces.com/critcmp_results'
for file in $old_file $new_file for file in $@
do do
file_s3_url="$s3_url/$file" file_s3_url="$s3_url/$file"
file_local_path="/tmp/$file" file_local_path="/tmp/$file"
@ -45,6 +33,12 @@ do
fi fi
done done
# Print the diff changes between the old and new benchmarks path_list=$(echo " $@" | sed 's/ / \/tmp\//g')
# by only displaying the lines that have a diff of more than 5%.
critcmp --threshold 5 "/tmp/$old_file" "/tmp/$new_file" if [[ ${#@} -gt 1 ]]; then
# Print the diff changes between the old and new benchmarks
# by only displaying the lines that have a diff of more than 5%.
critcmp --threshold 5 $path_list
else
critcmp $path_list
fi