Setting up Performance Tests in APEX
The apex-pdp has built in support for performance testing. A special performance testing REST server is available in the code base for performance testing. It is in the module performance-benchmark-test. To execute a benchmark test, you start the REST server, and then configure and run APEX against the server. There are example configurations for running tests in the resources of this module.
In order to run the test for 72 hours, set the batch count in the EventGeneratorConfig.json file to zero, which causes the REST server to generate batches forever.
Here is an example of how to do this:
- Clone and build the apex-pdp git repo
Go into the performance-benchmark-test module and run the REST server
cd testsuites/performance/performance-benchmark-test mvn exec:java -Dexec.mainClass="org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGenerator" -Dexec.args="-c src/main/resources/examples/benchmark/EventGeneratorConfig.json"
Separately, create a local directory and unzip the APEX tarball
mkdir apex cd apex tar zxvf ~/git/onap/policy/apex-pdp/packages/apex-pdp-package-full/target/*gz
Run APEX with a configuration that runs against the benchmark REST server, select the configuration that is appropriate for the number of threads for the number of cores on the host on which APEX is running. For example on a 32 core machine, select the "32" configuration, on an 8 code machine, select the "8" configuration.
bin/apexApps.sh engine -c ~/git/onap/policy/apex-pdp/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript64.json
To get the test results, Issue the following command using CURL or from a browser
curl http://localhost:32801/EventGenerator/Stats
The results are similar to those below: