Preconfiguration
Installing
Framework architecture
How to load Flask app
You need this items for performance framework
- Install docker Docker install website
- Install WSL 2 (optional)WSL2 install guide
- Install Java (8 version or higher)
For installing and building framework you need to:
- Download repository: here
- For quick install navigate to repository dir and choose framework load tool(jmeter or gatling).
docker-compose up -d
- If you want to install separate container
docker compose up -d kibana
docker compose up -d logstash
docker compose up -d filebeat
docker compose up -d metricbeat
docker compose up -d portainer
docker compose up -d web
docker compose up -d jenkins
If you want only build container use this command.
docker-compose build -d
After building and creating containers services have such adresses and ports:
- Jenkins: localhost:8080
- Kibana: localhost:5601
- Portainer: localhost:9000
- Flask app: localhost:5000
- Navigate to jenkins(Login: admin, Password: admin, localhost:8080).
- If you want to use github(by default basic scipts download from github repository) add credentials by this path options->credentials By default in jenkins you can see one job - gatling. It is gatling tests based on Gradle builder + gatling Job used pipeline script(Type of pipeline: scripted).
- Change you github credentials. Click on gatling job. Choose Configure.
- After that choose Pipeline syntax.
- Choose in dropdown git and fill all needed info.
- Add your credentials
- Generate and copy code.
- Paste into pipeline script.
- If you want to know more about pipeline scripting you may read more here
- Navigate to kibana(localhost:5601).
- You need to add dashboard.
- Open Settings.
- Open Saved objects.
- Click import and choose file in path(framework_path/kibana/gatling.ndjson or framework_path/kibana/jmeter.ndjson)
- After that check that you have all indices.
- Select index management. And check that you have gatling or jmeter index
- Run performance script to check that the framework works.
Framework consist of such aplications:
- Elasticsearch. Need to store all data and creating templates based on data.
- Kibana. Visualization of data.
- Filebeat. Need to read data from load machine and send to logstash.
- Logstash. Modify data to common format and send to elasticsearch.
- Metricbeat. Get server metrics from docker containers and from host.
- Jenkins. Automate performance process.Need to run gatling and jmeter jobs.
- Portainer. Managing all docker containers.
- Flask app. Simple application with blog. Store data in SQLite3
- Open command line and write command
ipconfig
- Copy IP address and add port 5000. The final address is: YOUR_IP:5000
- Add to your jmeter or gatling this address.
- Done
How to run jmeter test.
You can run test with parameters: THREAD - number of paralel users, LOOP - number of repeats, DURATION - duration of test(you can create perf test depends on loop or duration parameter. By default uses LOOP parameter).
Also you can add your own parameters to pipeline and performance script and customize this job or create another.
For performance monitoring to kibana dashboad added. Here some screenshots of vizualizations.
On the .gif you can see some vizualizations
- Jmeter_controls. Filters to choose Transaction name, Response code, CSV_File
- Jmeter_average. Average response time of all transactions. If you choose in jmeter-controls Transaction name the average response will filter for choosen transaction.
- Jmeter_percentiles. Percentiles of response time.
- Jmeter_Errors_Num. Show number of errors in the performance test.
- Jmeter_Data_Table. Show aggregate table metrics for each transactions.
- Jmeter_Response_Codes. Show response codes for all transactions.
- Jmeter_Response_Codes_Series. Show count of response codes depends on time.
- Jmeter_Response_Time_Percentiles. Show response percentiles.
- Jmeter_Count_vs_Average. Average response time distribution for each transaction.
- Jmeter_Response_Active_Threads. Average response time with number of active threads.
- Jmeter_Throughput. Number of transactions per time metric.
- Jmeter_Bytes. Number of received bytes.
You can add another vizualizations to dashboard or create your own based on jmeter index.