This repository has been archived by the owner on Aug 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
docker-compose-pg-load.yml
49 lines (46 loc) · 1.86 KB
/
docker-compose-pg-load.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
# docker-compose -f docker-compose-pg-load.yml up
version: '3.7'
services:
postgres-pgmonitor:
image: ${POSTGRES_IMAGE:-perconalab/percona-distribution-postgresql:13.3}
container_name: pmm-agent-postgres-pgmonitor
command: >
-c shared_preload_libraries=pg_stat_monitor
-c track_activity_query_size=2048
-c pg_stat_monitor.pgsm_query_max_len=10000
-c pg_stat_monitor.pgsm_normalized_query=0
-c track_io_timing=on
ports:
- 127.0.0.1:5432:5432
environment:
- POSTGRES_USER=pmm-agent
- POSTGRES_PASSWORD=pmm-agent-password
volumes:
- test_db_postgres:/docker-entrypoint-initdb.d/
postgres-load:
image: ${POSTGRES_IMAGE:-perconalab/percona-distribution-postgresql:13.3}
container_name: pmm-agent-postgres-load
depends_on:
- postgres-pgmonitor
command: >
bash -c "
sleep 20
PGPASSWORD=pmm-agent-password psql -Upmm-agent --host=pmm-agent-postgres-pgmonitor -c 'CREATE DATABASE contrib_regression;'
PGPASSWORD=pmm-agent-password psql -Upmm-agent --host=pmm-agent-postgres-pgmonitor -d contrib_regression -c 'CREATE EXTENSION pg_stat_monitor;'
PGPASSWORD=pmm-agent-password psql -Upmm-agent --host=pmm-agent-postgres-pgmonitor -d pmm-agent -c 'CREATE EXTENSION pg_stat_monitor;'
PGPASSWORD=pmm-agent-password psql -Upmm-agent --host=pmm-agent-postgres-pgmonitor -d postgres -c 'CREATE EXTENSION pg_stat_monitor;'
while true
do
PGPASSWORD=pmm-agent-password psql -Upmm-agent --host=pmm-agent-postgres-pgmonitor -d contrib_regression -f /testqueries/pg_stat_monitor_load.sql -o /dev/null
sleep 30
done
tail -f /dev/null
"
environment:
- POSTGRES_USER=pmm-agent
- POSTGRES_PASSWORD=pmm-agent-password
volumes:
- ./testqueries/postgres:/testqueries/
volumes:
test_db_postgres: