-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdatabase_server.cfg
More file actions
42 lines (37 loc) · 1.84 KB
/
Copy pathdatabase_server.cfg
File metadata and controls
42 lines (37 loc) · 1.84 KB
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
# Database Server Configuration
[Coordinator]
player = 10.0.2.10 # Database server IP
conductor = 10.0.2.100 # Conductor IP
cmdport = 6970
resultsport = 6971
[Startup]
# Prepare database for testing
step1 = echo "Preparing database server"
step2 = sudo systemctl restart postgresql
step3 = psql -U postgres -c "CREATE DATABASE IF NOT EXISTS testdb;"
step4 = psql -U postgres testdb -c "CREATE TABLE IF NOT EXISTS test_data (id SERIAL PRIMARY KEY, data TEXT, created_at TIMESTAMP DEFAULT NOW());"
step5 = psql -U postgres testdb -c "TRUNCATE test_data;"
step6 = mkdir -p /tmp/db_test_results
[Run]
# Monitor database during test
spawn1 = pg_stat_activity > /tmp/db_test_results/connections.log
spawn2 = while true; do psql -U postgres -c "SELECT count(*) FROM test_data;" >> /tmp/db_test_results/row_count.log; sleep 1; done
spawn3 = vmstat 1 > /tmp/db_test_results/vmstat.log
spawn4 = iostat -x 1 > /tmp/db_test_results/iostat.log
# Periodic health checks
timeout5 = psql -U postgres -c "SELECT 1;" || echo "Database health check failed"
[Collect]
# Gather database metrics and logs
step1 = echo "Collecting database server results"
step2 = psql -U postgres -c "SELECT * FROM pg_stat_database WHERE datname='testdb';" > /tmp/db_test_results/db_stats.txt
step3 = psql -U postgres -c "SELECT * FROM pg_stat_user_tables;" > /tmp/db_test_results/table_stats.txt
step4 = psql -U postgres testdb -c "SELECT count(*) as total_rows FROM test_data;" > /tmp/db_test_results/final_count.txt
step5 = sudo cp /var/log/postgresql/postgresql-*.log /tmp/db_test_results/
step6 = tar -czf /tmp/database_results.tgz /tmp/db_test_results/
[Reset]
# Clean up database
step1 = echo "Cleaning up database"
step2 = psql -U postgres testdb -c "DROP TABLE test_data;"
step3 = psql -U postgres -c "DROP DATABASE testdb;"
step4 = rm -rf /tmp/db_test_results
step5 = echo "Database reset complete"