From bda88800682c5ec4bb8764ccf4af01d296f97461 Mon Sep 17 00:00:00 2001 From: AmaliMatharaarachchi Date: Wed, 4 Oct 2023 15:38:04 +0530 Subject: [PATCH] fix perf run scripts --- test/performance/README.md | 32 +++++++++++++++++++++++++++++--- test/performance/apk-test.jmx | 2 +- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/test/performance/README.md b/test/performance/README.md index 820195439..11e8bdca9 100644 --- a/test/performance/README.md +++ b/test/performance/README.md @@ -66,7 +66,7 @@ helm3 install apk-perftest -n apk-perf-test . 1. Navigate to `test/performance/artifacts/` and create the API: ```bash -kubectl -n apk-performance apply -f . +kubectl -n apk-perf-test apply -f . ``` Note: If you want to use a custom keystore.jks file other than `APK_HOME/test/performance/keystore.jks` then update the `APK_HOME/test/performance/artifacts/custom-jwt-cm.yaml` with the correct public key. @@ -75,7 +75,7 @@ Note: If you want to use a custom keystore.jks file other than `APK_HOME/test/pe Execute the following command to determine the private IP of the gateway load balancer: ```bash -IP=$(kubectl get svc apk-test-setup-wso2-apk-router-service -n apk-integration-test --output jsonpath='{.status.loadBalancer.ingress[0].ip}') +IP=$(kubectl get svc apk-perftest-wso2-apk-gateway-service -n apk-perf-test --output jsonpath='{.status.loadBalancer.ingress[0].ip}') # Note: IP should be within the range of your subnet addresses. ``` @@ -96,6 +96,32 @@ Before setting up the JMeter servers, ensure the following prerequisites are met - JMeter version 5.5 - Install JMeter on all three servers by downloading and extracting the JMeter package in the {$HOME} directory. - kubectl 1.27 or higher - jq +- login to az cluster + +Run following commands in JMeter VMs; + +```bash +sudo apt install openjdk-11-jre-headless +sudo snap install kubectl --classic +wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.5.tgz +tar -xvzf apache-jmeter-5.5.tgz apache-jmeter-5.5 +sudo apt install jq + +cd apache-jmeter-5.5/bin/ +mkdir payloads +chmod 755 payloads +cd +git clone https://github.com/wso2/apk +cd apk/test/performance/jwt-tokens/ +./generate-jwt-tokens.sh -t 10000 -c 1234 +cd +cp apk/test/performance/payloads/ apache-jmeter-5.5/bin/ -r +sudo nano /etc/hosts +# add default.gw.wso2.com +sudo apt install azure-cli +az login +#connect to cluster +``` ### Generate Custom JWT Tokens @@ -106,7 +132,7 @@ Follow these steps in all three jmeter servers ```bash git clone https://github.com/wso2/apk -cd apk/test/performance/JwtTokens +cd apk/test/performance/jwt-tokens/ ``` 2. [Optional] If needed, replace `test/performance/jwt-tokens/keystore.jks` with your keystore file. diff --git a/test/performance/apk-test.jmx b/test/performance/apk-test.jmx index 83510bfb0..2882b9b29 100644 --- a/test/performance/apk-test.jmx +++ b/test/performance/apk-test.jmx @@ -28,7 +28,7 @@ - ${__P(tokens_path,/home/azureuser/apk-load-testing/jwt-tokens/target/jwt-tokens-500.csv)} + ${__P(tokens_path,/home/azureuser/apk/jwt-tokens/target/jwt-tokens-500.csv)} token ,