mirror of
https://github.com/logos-messaging/logos-messaging-test-query.git
synced 2026-05-05 17:39:26 +00:00
simplification of database hammer code base
This commit is contained in:
parent
1f7c2a710d
commit
7bb415eeae
@ -120,12 +120,15 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./run_database_hammer.sh:/opt/run_database_hammer.sh:Z
|
- ./run_database_hammer.sh:/opt/run_database_hammer.sh:Z
|
||||||
entrypoint: sh
|
entrypoint: sh
|
||||||
replicas: 3
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
replicas: 1
|
||||||
command:
|
command:
|
||||||
- /opt/run_database_hammer.sh
|
- /opt/run_database_hammer.sh
|
||||||
depends_on:
|
depends_on:
|
||||||
- nwaku_postgres
|
- postgres
|
||||||
- nwaku_sqlite
|
networks:
|
||||||
|
- simulation
|
||||||
|
|
||||||
waku-store-query-generator:
|
waku-store-query-generator:
|
||||||
image: ivansete/waku-store-request-maker:19e645
|
image: ivansete/waku-store-request-maker:19e645
|
||||||
|
|||||||
@ -3,23 +3,20 @@
|
|||||||
## This script is aimed to generate traffic to the database and simulate
|
## This script is aimed to generate traffic to the database and simulate
|
||||||
## simulate multiple Waku nodes connected to the same database.
|
## 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
|
## Install postgresql-client for psql command
|
||||||
apk --no-cache add postgresql-client
|
apk --no-cache add postgresql-client
|
||||||
|
|
||||||
## The port numbers and host names are defined in the 'docker-compose.yml' file
|
## 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
|
while true
|
||||||
do
|
do
|
||||||
echo "Before making query"
|
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
|
sleep 10
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user