this project was build for performance testing courses. don't judge strictly
- The working directory throughout the entire master class will be located in the root directory of your user account if you are using a Unix-like system, or on drive C if you are using Windows. This is where we will place the cloned project.
mkdir ~/projects/ &&
cd ~/projects/ &&
git clone https://github.com/timofeevmd/service_reservation.git-
-
brew install openjdk@11
- Expected result
Outputjava --version
openjdk 11.0.26 2025-01-21 OpenJDK Runtime Environment Homebrew (build 11.0.26+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.26+0, mixed mode)
troubleshooting
- if you had different java version, check the link for switch between your jdk's
-
- manual
- if manual is not work
wget https://builds.openlogic.com/downloadJDK/openlogic-openjdk/11.0.26+4/openlogic-openjdk-11.0.26+4-linux-64.tar.gz- if wget is not work try to download openjdk-11-...
sudo mkdir -p /opt/java && cd /opt/java && sudo tar -xvzf ~/openlogic-openjdk-11.0.26+4-linux-x64.tar.gz && sudo mv openlogic-openjdk-11.0.26+4-linux-x64 java-11 && sudo vim /etc/profile.d/java.sh
- set of them
export JAVA_HOME=/opt/java/java-11 export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile.d/java.sh- Expected result
java --version
Output
openjdk 11.0.26 2025-01-21 OpenJDK Runtime Environment Homebrew (build 11.0.26+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.26+0, mixed mode)
troubleshooting
- if you had different java version, check the link for switch between your jdk's
-
-
Follow the installation wizard, choosing 'Set JAVA_HOME variable'
-
Note the installation path (usually C:\Program Files\OpenLogic\jdk-11.0.26.4-hotspot\ or C:\Program Files\Java\jdk-11).
-
Open Control Panel → System → Advanced system settings.
-
Go to the Advanced tab and click Environment Variables.
-
Under System Variables
-
Find the
JAVA_HOMEvariable (if it does not exist, click New) -
Set
JAVA_HOME=C:\Program Files\OpenLogic\jdk-11.0.26.4-hotspot\ -
Find Path → click Edit → New
-
Set
%JAVA_HOME%\bin -
Expected result
java --version
Output
openjdk 11.0.26 2025-01-21 OpenJDK Runtime Environment OpenLogic-OpenJDK (build 11.0.26+4-adhoc..jdk11u) OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 11.0.26+4-adhoc..jdk11u, mixed mode)
troubleshooting
- if you had different java version, check the link for switch between your jdk's
-
-
- manual for macOs/linux/windows
- Expected result
Outputmvn --version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) Maven home: /opt/homebrew/Cellar/maven/3.9.9/libexec Java version: 11.0.19, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "15.3.2", arch: "aarch64", family: "mac"
- manual for macOs/linux/windows
-
- manual for macOs/linux/windows
- Expected result
Output like this
docker --version && docker-compose --versionDocker version 24.0.6, build ed223bc Docker Compose version v2.23.0-desktop.1
troubleshooting
-
Error permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.48/containers/json?all=1": dial unix /var/run/docker.sock: connect: permission denied
sudo groupadd docker && sudo usermod -aG docker $USER && newgrp docker && reboot
-
- macOs
mkdir ~/tools/ && cd ~/tools/ && curl -OL https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.1.zip unzip apache-jmeter-5.4.1.zip && cd ./apache-jmeter-5.4.1/bin/ && ./jmeter
- linux
mkdir ~/tools/ && cd ~/tools/ && wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.1.tgz && tar -xvzf apache-jmeter-5.4.1.tgz && cd ./apache-jmeter-5.4.1/bin/ && ./jmeter
- windows
- downloads .zip
- unzip .zpi arch
- run jmeter.bat
- macOs
WARNING
-
open
.envfile on the root of project- If your laptop has an Intel or Ryzen CPU, change
PLATFORMparm tolinux/amd64 - If your laptop has M1 or newer chip, change
PLATFORMparm tolinux/arm64
- If your laptop has an Intel or Ryzen CPU, change
-
- from root directory start docker-compose reservation_service
docker-compose -f docker-compose.yml up -d
- check current state
docker ps -a
- expected result
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8472204b071f influxdb:1.8 "/entrypoint.sh infl…" 2 days ago Up 22 minutes 0.0.0.0:8083->8083/tcp, 0.0.0.0:8086->8086/tcp influxdb 5516036bb73b michaelt1223/perf_sr_frontend:latest "/docker-entrypoint.…" 5 days ago Up 22 minutes 80/tcp, 0.0.0.0:3000->3000/tcp frontend 7fde5b402724 michaelt1223/perf_sr_backend:latest "java -jar app.jar" 5 days ago Up 22 minutes 0.0.0.0:8080->8080/tcp backend f08d6be43900 postgres:latest "docker-entrypoint.s…" 5 days ago Up 22 minutes (healthy) 0.0.0.0:5432->5432/tcp database de5d1b1f9e26 prom/prometheus:latest "/bin/prometheus --c…" 5 days ago Up 22 minutes 0.0.0.0:9091->9090/tcp prometheus 28fd29a8499a grafana/grafana:latest "/run.sh" 5 days ago Up 22 minutes 0.0.0.0:3001->3000/tcp grafana 7e25219f1688 quay.io/prometheus/node-exporter:latest "/bin/node_exporter" 5 days ago Up 22 minutes 0.0.0.0:9100->9100/tcp node_exporter aee27e4ea7b1 gcr.io/cadvisor/cadvisor:latest "/usr/bin/cadvisor -…" 5 days ago Up 22 minutes (unhealthy) 8080/tcp, 0.0.0.0:8081->8081/tcp cadvisor
- from root directory start docker-compose reservation_service
-
- INFO
- official docs
- grafana dashboards
- standard username:
admin, password:admin
- how to connect data bases:
- prometheus -> go to
- local grafana
- select prometheus
- click
add new data sourcebutton - set
http://prometheus:9090into the inputfield "Prometheus server URL" - click
Save and testbutton onto the futter
- influx -> go to
- local grafana
- select influxdb
- click
add new data sourcebutton - set
http://influxdb:8086into http part fieldURL - on the
InfluxDB Detailspart - fields:
- database:
loadTestingDB - user:
admin - password:
admin
- database:
- import dashboards:
- for prometheus
- for cAdvisor -> go to
- for node_exporter -> go to
- local grafana
- click
newbutton ->importbutton- into the
Find and import dashboardsfield set id1860for node_exporter dashboard - click
Loadbutton - choose prometheus as database
- click the
importbutton
- into the
- for postgres_exporter -> go to
- local grafana
- click
newbutton ->importbutton- into the
Find and import dashboardsfield set id9628for postgres_exporter dashboard - click
Loadbutton - choose prometheus as database
- click the
importbutton
- into the
- influx
- standard username:
admin, password:admin- for JMeter -> go to
- local grafana
- click
newbutton ->importbutton- into the
Find and import dashboardsfield set id5496for Apache JMeter dashboard - click
Loadbutton - choose influxDB as datasource
- click the
importbutton
- into the
- for JMeter -> go to
- for prometheus
- prometheus -> go to
- INFO
-
- special config if your based system is
Windows- go to prometheus config file
monitoring/config/prometheus.yml - on the scrape config section you need to change each part of
job_name- targets: ['cadvisor:8081'] -> targets: ['localhost:8081']
- targets: ['node_exporter:9100'] -> targets: ['localhost:9100']
- targets: ['postgres_exporter:9187'] -> targets: ['localhost:9187']
- targets: ['backend:8080'] -> targets: ['localhost:8080']
- go to prometheus config file
- INFO
- prometheus config file
monitoring/config/prometheus.yml - prometheus node down alerting config
monitoring/config/node_down.yml - official docs
- prometheus config file
- special config if your based system is
-
- INFO
- official docs
- INFO
-
- INFO
- official docs
- INFO