Skip to content

Commit

Permalink
Tests (#17)
Browse files Browse the repository at this point in the history
* add tests
* confirmed support of mongodb 8.0
  • Loading branch information
andrii29 authored Nov 26, 2024
1 parent 684ac64 commit 95b25c4
Show file tree
Hide file tree
Showing 11 changed files with 1,116 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ db.setProfilingLevel(1, { slowms: 100 }) // Enable profiling again
### Supported MongoDB versions
```
4.4, 5.0, 6.0, 7.0
4.4, 5.0, 6.0, 7.0, 8.0
```

### Grafana Dashboard
Expand Down
1 change: 1 addition & 0 deletions tests/docker-compose/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGODB_VERSION=8.0
10 changes: 10 additions & 0 deletions tests/docker-compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```
cat .env
docker network create tests --subnet 172.14.24.0/24
docker compose up -d
docker compose exec mongodb bash /scripts/prepare.sh
docker compose exec mongodb bash /scripts/query.sh
http://127.0.0.1:3000
docker compose logs mongodb-profiler-exporter -f
docker compose down
```
52 changes: 52 additions & 0 deletions tests/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- 9090:9090
volumes:
- ./prometheus:/etc/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
restart: always

grafana:
image: grafana/grafana:9.2.15
container_name: grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
ports:
- 3000:3000
volumes:
- ./grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/datasources:/etc/grafana/provisioning/datasources
depends_on:
- prometheus
restart: always

mongodb:
image: mongo:${MONGODB_VERSION}
container_name: mongodb
ports:
- 27017:27017
volumes:
- ./mongodb/scripts:/scripts
restart: always

mongodb-profiler-exporter:
image: andriik/mongodb-profiler-exporter
container_name: mongodb-profiler-exporter
environment:
MONGODB_URI: mongodb://mongodb:27017/
VERBOSE: true
ports:
- 9179:9179
depends_on:
- mongodb
restart: always

## docker network create tests --subnet 172.14.24.0/24
networks:
default:
external: true
name: tests
11 changes: 11 additions & 0 deletions tests/docker-compose/grafana/dashboards/dashboards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: 1

providers:
- name: 'mongodb-profiler-exporter'
orgId: 1
folder: ''
type: file
disableDeletion: false
updateIntervalSeconds: 600
options:
path: /etc/grafana/provisioning/dashboards
Loading

0 comments on commit 95b25c4

Please sign in to comment.