Created
May 6, 2022 16:38
-
-
Save thyandrecardoso/cfe24e872d911c524ac7b3d071f82377 to your computer and use it in GitHub Desktop.
Testing Elasticsearch indexing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
port=9201 | |
branch=$(git describe --tags) | |
jvm=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}') | |
for indexIdx in {1..3}; do | |
curl -sX DELETE "http://localhost:$port/test-index-temp-$indexIdx" >/dev/null | |
done | |
start_time=$(date +%s) | |
for indexIdx in {1..3}; do | |
for d in {1..100}; do | |
curl -sX POST "http://localhost:$port/test-index-temp-$indexIdx/_doc/" -H 'Content-Type: application/json' -d'{"user": {"id": "'"test-$d"'"}}' >/dev/null | |
done | |
done | |
end_time=$(date +%s) | |
elapsed=$((end_time - start_time)) | |
echo "Testing in branch '$branch' and JVM '$jvm' took $elapsed seconds." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment