Skip to content

Commit

Permalink
chore: perftests should use API instead of influx cli (#21909)
Browse files Browse the repository at this point in the history
  • Loading branch information
codyshepherd committed Jul 22, 2021
1 parent 9b6527a commit bfe8077
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/ci/run_perftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cat << EOF > /etc/telegraf/telegraf.conf
json_time_key = "time"
json_time_format = "unix"
tag_keys = [
"i_type"
"i_type",
"query_format"
]
EOF
Expand Down Expand Up @@ -117,7 +117,7 @@ for scale in 50 100 500; do
# run ingest tests
cat ${DATASET_DIR}/$data_fname | $GOPATH/bin/bulk_load_influx $load_opts | jq ". += {branch: \"${INFLUXDB_VERSION}\", commit: \"${TEST_COMMIT}\", time: \"$datestring\", i_type: \"${DATA_I_TYPE}\"}" > $working_dir/test-ingest-$scale_string-batchsize-$batch-workers-$workers.json

bucket_id=$(influx bucket list --host http://${NGINX_HOST}:8086 -n ${db_name} -o $TEST_ORG --token $TEST_TOKEN | head -2 | tail -1 | cut -d ' ' -f1)
bucket_id=$(curl -H "Authorization: Token $TEST_TOKEN" "http://${NGINX_HOST}:8086/api/v2/buckets?org=$TEST_ORG" | jq -r ".buckets[] | select(.name | contains(\"$db_name\")).id")
sleep 1
# stop daemon and force compaction
systemctl stop influxdb
Expand All @@ -135,11 +135,15 @@ for scale in 50 100 500; do
# run influxql and flux query tests
for query_file in $query_files; do
format=$(echo $query_file | cut -d '-' -f7)
cat ${DATASET_DIR}/$query_file | ${GOPATH}/bin/query_benchmarker_influxdb --urls=http://localhost:8086 --debug=0 --print-interval=0 --workers=$workers --json=true | jq ". += {branch: \"${INFLUXDB_VERSION}\", commit: \"${TEST_COMMIT}\", time: \"$datestring\", i_type: \"${DATA_I_TYPE}\", query_format: \"$format\"}" > $working_dir/test-query-$scale_string-format-$format-workers-$workers.json
cat ${DATASET_DIR}/$query_file | ${GOPATH}/bin/query_benchmarker_influxdb --urls=http://localhost:8086 --debug=0 --print-interval=0 --workers=$workers --json=true --organization=$TEST_ORG --token=$TEST_TOKEN | jq ". += {branch: \"${INFLUXDB_VERSION}\", commit: \"${TEST_COMMIT}\", time: \"$datestring\", i_type: \"${DATA_I_TYPE}\", query_format: \"$format\"}" > $working_dir/test-query-$scale_string-format-$format-workers-$workers.json
done

# delete db to start anew
influx bucket delete -o $TEST_ORG -t $TEST_TOKEN -n $db_name
delete_response=$(curl -s -o /dev/null -X DELETE -H "Authorization: Token $TEST_TOKEN" "http://${NGINX_HOST}:8086/api/v2/buckets/$bucket_id?org=$TEST_ORG" -w %{http_code})
if [ $delete_response != "204" ]; then
echo "bucket not deleted!"
exit 1
fi
done
done

Expand Down

0 comments on commit bfe8077

Please sign in to comment.