2021-06-01 13:56:11 +02:00
|
|
|
#!/usr/bin/env bash
|
2021-05-26 15:57:22 +02:00
|
|
|
|
|
|
|
# Requirements:
|
|
|
|
# - critcmp. See: https://github.com/BurntSushi/critcmp
|
2021-06-01 16:37:57 +02:00
|
|
|
# - curl
|
2021-05-26 15:57:22 +02:00
|
|
|
|
|
|
|
# Usage
|
|
|
|
# $ bash compare.sh json_file1 json_file1
|
|
|
|
# ex: bash compare.sh songs_main_09a4321.json songs_geosearch_24ec456.json
|
|
|
|
|
|
|
|
# Checking that critcmp is installed
|
|
|
|
command -v critcmp > /dev/null 2>&1
|
|
|
|
if [[ "$?" -ne 0 ]]; then
|
2021-06-03 15:39:52 +02:00
|
|
|
echo 'You must install critcmp to make this script work.'
|
2021-05-26 15:57:22 +02:00
|
|
|
echo 'See: https://github.com/BurntSushi/critcmp'
|
2021-06-03 15:39:52 +02:00
|
|
|
echo ' $ cargo install critcmp'
|
2021-05-26 15:57:22 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-06-01 14:43:47 +02:00
|
|
|
s3_url='https://milli-benchmarks.fra1.digitaloceanspaces.com/critcmp_results'
|
2021-05-26 15:57:22 +02:00
|
|
|
|
2021-09-16 11:25:51 +02:00
|
|
|
for file in $@
|
2021-06-03 15:39:52 +02:00
|
|
|
do
|
|
|
|
file_s3_url="$s3_url/$file"
|
|
|
|
file_local_path="/tmp/$file"
|
|
|
|
|
|
|
|
if [[ ! -f $file_local_path ]]; then
|
|
|
|
curl $file_s3_url --output $file_local_path --silent
|
|
|
|
if [[ "$?" -ne 0 ]]; then
|
|
|
|
echo 'curl command failed.'
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-06-01 13:56:42 +02:00
|
|
|
fi
|
2021-06-03 15:39:52 +02:00
|
|
|
done
|
2021-05-26 15:57:22 +02:00
|
|
|
|
2021-09-16 11:25:51 +02:00
|
|
|
path_list=$(echo " $@" | sed 's/ / \/tmp\//g')
|
|
|
|
|
2022-04-13 15:24:54 +02:00
|
|
|
critcmp $path_list
|