2020-03-18 01:28:57 +00:00
#!/bin/bash
set -ex
set -o pipefail
trap "exit" INT TERM
2020-04-17 15:47:01 +00:00
trap 'kill $(jobs -pr) ||:' EXIT
2020-03-18 01:28:57 +00:00
mkdir db0 || :
2020-04-22 21:39:51 +00:00
mkdir left || :
mkdir right || :
2020-03-18 01:28:57 +00:00
left_pr = $1
left_sha = $2
right_pr = $3
right_sha = $4
datasets = ${ CHPC_DATASETS :- "hits1 hits10 hits100 values" }
declare -A dataset_paths
dataset_paths[ "hits10" ] = "https://s3.mds.yandex.net/clickhouse-private-datasets/hits_10m_single/partitions/hits_10m_single.tar"
dataset_paths[ "hits100" ] = "https://s3.mds.yandex.net/clickhouse-private-datasets/hits_100m_single/partitions/hits_100m_single.tar"
dataset_paths[ "hits1" ] = "https://clickhouse-datasets.s3.yandex.net/hits/partitions/hits_v1.tar"
dataset_paths[ "values" ] = "https://clickhouse-datasets.s3.yandex.net/values_with_expressions/partitions/test_values.tar"
function download
{
# might have the same version on left and right
if ! [ " $left_sha " = " $right_sha " ]
then
wget -nv -nd -c " https://clickhouse-builds.s3.yandex.net/ $left_pr / $left_sha /performance/performance.tgz " -O- | tar -C left --strip-components= 1 -zxv &
wget -nv -nd -c " https://clickhouse-builds.s3.yandex.net/ $right_pr / $right_sha /performance/performance.tgz " -O- | tar -C right --strip-components= 1 -zxv &
else
2020-04-28 07:45:35 +00:00
mkdir right || :
wget -nv -nd -c " https://clickhouse-builds.s3.yandex.net/ $left_pr / $left_sha /performance/performance.tgz " -O- | tar -C left --strip-components= 1 -zxv && cp -a left/* right &
2020-03-18 01:28:57 +00:00
fi
for dataset_name in $datasets
do
dataset_path = " ${ dataset_paths [ $dataset_name ] } "
2020-04-22 21:39:51 +00:00
if [ " $dataset_path " = "" ]
then
>& 2 echo " Unknown dataset ' $dataset_name ' "
exit 1
fi
2020-03-18 01:28:57 +00:00
cd db0 && wget -nv -nd -c " $dataset_path " -O- | tar -xv &
done
mkdir ~/fg || :
2020-05-22 08:40:02 +00:00
(
cd ~/fg
wget -nv -nd -c "https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl"
wget -nv -nd -c "https://raw.githubusercontent.com/brendangregg/FlameGraph/master/difffolded.pl"
chmod +x ~/fg/difffolded.pl
chmod +x ~/fg/flamegraph.pl
) &
2020-03-18 01:28:57 +00:00
wait
}
download