./gradlew :performance-test:gatlingRun
If you need to run a task several times in a row (with different environment or configuration), you may use the --rerun-tasks flag.
example:
./gradlew --rerun-tasks :performance-test:gatlingRun
To run TargetRpsSimulation. Source code available at ./performance-test/src/gatling/java/org/opensearch/dataprepper/test/performance/TargetRpsSimulation.java
# ./gradlew gatlingRun-<simulation-class-path>
./gradlew :performance-test:gatlingRun-org.opensearch.dataprepper.test.performance.TargetRpsSimulation
You can configure the test in order to target different endpoints with different configurations. Supply the configurations as Java system variables on the command line.
For example, you can configure the port and use HTTPS with a custom certificate with the following:
./gradlew -Dport=7099 -Dprotocol=https -Dpath=/simple-sample-pipeline/logs -Djavax.net.ssl.keyStore=examples/demo/test_keystore.p12 :performance-test:gatlingRun-org.opensearch.dataprepper.test.performance.SingleRequestSimulation
Available configuration options:
host
- The host name or a comma-delimited list of host names. Defaults tolocalhost
.port
- The destination port. The default value is2021
.protocol
- The scheme to use in the URL. Can behttp
orhttps
. Defaults tohttp
.path
- The path of the HTTP endpoint. This uses the defaulthttp
path of/log/ingest
.authentication
- The authentication to use with the target. Currently supportsaws_sigv4
.aws_region
- The AWS region to use in signing. Required withaws_sigv4
authentication.aws_service
- The AWS service name to use in signing. Required withaws_sigv4
authentication.
This performance tool also works with Amazon OpenSearch Ingestion.
Setup your AWS credentials to meet your needs. Then run a command similar to the following:
./gradlew -Dhost=<your-custom-dns>.<aws-region>.osis.amazonaws.com -Dprotocol=https -Dpath=<your-path> -Dport=443 -Dauthentication=aws_sigv4 -Daws_region=<aws-region> -Daws_service=osis :performance-test:gatlingRun-org.opensearch.dataprepper.test.performance.SingleRequestSimulation
./gradlew :performance-test:compileGatlingJava
You can also create an uber-jar that has everything needed to run the Gatling performance tests so that you can deploy them easily.
./gradlew :performance-test:assemble
This will create an uber jar in performance-test/build/libs
with the name opensearch-data-prepper-performance-test-${VERSION}.jar
You can run this using a command similar to the following.
java -jar performance-test/build/libs/opensearch-data-prepper-performance-test-2.11.0-SNAPSHOT.jar -s org.opensearch.dataprepper.test.performance.StaticRequestSimulation
Gatling Quickstart Gatling Advanced Simulations Passing Command Line Parameters Gatling Gradle Plugin