Skip to content

Commit 2e31f06

Browse files
authored
Bael 5895 gatling monitoring (#18393)
* [BAEL-5895] Add docker-compose with grafana and prometheus * [BAEL-5895] Containerized the service * Added the new endpoints to use in gatling tests * Added gatling simulations for the new endpoints * [BAEL-5895] Introduced influxDB * Configured gatling to expose metrics to influx-db * [BAEL-5895] Added all services in docker-compose * Added some default dashboards and datasources for grafana * fix indentation in java classes * [BAEL-5895] Refactor Gatling Simulations to make them more readable for the article
1 parent ad0f09a commit 2e31f06

File tree

20 files changed

+2881
-13
lines changed

20 files changed

+2881
-13
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM openjdk:17-jdk-slim
2+
3+
COPY target/gatling-java.jar app.jar
4+
ENTRYPOINT ["java","-jar","/app.jar"]
5+
6+
EXPOSE 8080
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
### Relevant Articles:
2+
23
- [Load Testing Rest Endpoint Using Gatling](https://www.baeldung.com/gatling-load-testing-rest-endpoint)
34
- [How to Display a Full HTTP Response Body With Gatling](https://www.baeldung.com/java-gatling-show-response-body)
45

5-
66
### Running a simualtion
7-
To run the simulation from command prompt use mvn gatling:test
7+
8+
To run the simulations from command prompt use `mvn gatling:test`. This will trigger all 3 simulations: EmployeeRegistrationSimulation, FetchSinglePostSimulation and FetchSinglePostSimulationLog.
9+
10+
For executing any other simulations, use `mvn gatling:test -Dgatling.simulationClass=org.baeldung.FastEndpointSimulation`
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
version: '3'
2+
3+
services:
4+
influxdb:
5+
build: influxDb
6+
container_name: influxdb
7+
ports:
8+
- '8086:8086'
9+
- '2003:2003'
10+
environment:
11+
- INFLUX_USER=admin
12+
- INFLUX_PASSWORD=admin
13+
- INFLUX_DB=influx
14+
volumes:
15+
- influxdb_data:/var/lib/influxdb
16+
17+
prometheus:
18+
build: prometheus
19+
container_name: prometheus
20+
depends_on:
21+
- service
22+
ports:
23+
- "9090:9090"
24+
volumes:
25+
- prometheus_data:/prometheus
26+
27+
grafana:
28+
build: grafana
29+
container_name: grafana
30+
ports:
31+
- "3000:3000"
32+
environment:
33+
- GF_SECURITY_ADMIN_USER=admin
34+
- GF_SECURITY_ADMIN_PASSWORD=admin
35+
volumes:
36+
- grafana_data:/var/lib/grafana
37+
38+
service:
39+
build: .
40+
container_name: service
41+
ports:
42+
- "8080:8080"
43+
44+
volumes:
45+
influxdb_data: {}
46+
grafana_data: {}
47+
prometheus_data: {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM grafana/grafana:10.2.2
2+
3+
COPY provisioning/ /etc/grafana/provisioning/
4+
COPY dashboards/ /etc/grafana/provisioning/dashboards
5+
6+
EXPOSE 3000:3000

0 commit comments

Comments
 (0)