2013-05-01 13:51:26 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
echo "This will run a query against a stand-alone version of Druid"
|
|
|
|
echo " before running this, do: run_example_server.sh"
|
|
|
|
set +u
|
|
|
|
shopt -s xpg_echo
|
|
|
|
shopt -s expand_aliases
|
|
|
|
trap "exit 1" 1 2 3 15
|
|
|
|
|
|
|
|
SCRIPT_DIR=`dirname $0`
|
|
|
|
CURR_DIR=`pwd`
|
|
|
|
cd ${SCRIPT_DIR}
|
|
|
|
SCRIPT_DIR=`pwd`
|
|
|
|
cd ${CURR_DIR}
|
|
|
|
|
2015-02-11 11:10:58 -05:00
|
|
|
source $SCRIPT_DIR/select_example.sh
|
2013-05-01 13:51:26 -04:00
|
|
|
|
2015-02-11 11:10:58 -05:00
|
|
|
select_example QUERY_FILE "${SCRIPT_DIR}/examples" "*query.body" "${1}" "query.body"
|
2013-05-01 13:51:26 -04:00
|
|
|
|
|
|
|
cat ${QUERY_FILE}
|
2015-02-11 11:10:58 -05:00
|
|
|
for delay in 5 30 30 30 30 30 30 30 30 30 30
|
2013-05-01 13:51:26 -04:00
|
|
|
do
|
|
|
|
echo "sleep for $delay seconds..."
|
2015-02-11 11:10:58 -05:00
|
|
|
echo " "
|
2013-05-01 13:51:26 -04:00
|
|
|
sleep $delay
|
2015-02-18 14:46:27 -05:00
|
|
|
curl -X POST 'http://localhost:8084/druid/v2/?pretty' -H 'content-type: application/json' -d "`cat ${QUERY_FILE}`"
|
2013-05-01 13:51:26 -04:00
|
|
|
echo " "
|
|
|
|
echo " "
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "$0 finished"
|