mirror of
https://github.com/logos-messaging/logos-messaging-test-query.git
synced 2026-01-05 23:43:08 +00:00
simplification of database hammer code base
This commit is contained in:
parent
1f7c2a710d
commit
7bb415eeae
@ -120,12 +120,15 @@ services:
|
||||
volumes:
|
||||
- ./run_database_hammer.sh:/opt/run_database_hammer.sh:Z
|
||||
entrypoint: sh
|
||||
replicas: 3
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
command:
|
||||
- /opt/run_database_hammer.sh
|
||||
depends_on:
|
||||
- nwaku_postgres
|
||||
- nwaku_sqlite
|
||||
- postgres
|
||||
networks:
|
||||
- simulation
|
||||
|
||||
waku-store-query-generator:
|
||||
image: ivansete/waku-store-request-maker:19e645
|
||||
|
||||
@ -3,23 +3,20 @@
|
||||
## This script is aimed to generate traffic to the database and simulate
|
||||
## simulate multiple Waku nodes connected to the same database.
|
||||
|
||||
## Install the `dig` command
|
||||
apk --no-cache add bind-tools
|
||||
|
||||
## Install postgresql-client for psql command
|
||||
apk --no-cache add postgresql-client
|
||||
|
||||
## The port numbers and host names are defined in the 'docker-compose.yml' file
|
||||
nwaku-postgres-IP=$(dig +short postgres)
|
||||
target-postgres="http://${nwaku-postgres-IP}:5432"
|
||||
|
||||
echo "This is publisher: ${target-postgres}; ${target_sqlite}"
|
||||
echo "This is database hammer"
|
||||
|
||||
export PGPASSWORD=test123
|
||||
QUERY_LAST_FIVE_MINUTES=$(echo 'SELECT * FROM messages ORDER BY storedAt DESC LIMIT 100;')
|
||||
|
||||
query-last-five-minutes="SELECT storedAt, contentTopic, payload, pubsubTopic, version, timestamp, id FROM messages WHERE storedAt >= EXTRACT(EPOCH FROM (NOW() - INTERVAL '5 minutes')) * 1000 ORDER BY storedAt DESC;"
|
||||
while true
|
||||
do
|
||||
echo "Before making query"
|
||||
psql -h ${nwaku-postgres-IP} -U postgres -W test123 -U postgres -c "${query-last-five-minutes}"
|
||||
psql -h postgres -p 5432 -U postgres -U postgres -w -c "${QUERY_LAST_FIVE_MINUTES}"
|
||||
|
||||
sleep 10
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user