memgraph/tests/client-stress.sh
Matej Ferencevic 813a3b9eed Started network refactorization.
Summary:
Moved server and worker from bolt to communication. Started
templatization.

Started removal of Bolt class.

Removed unnecessary files from network.

Converted states to template functions.

Bolt::Session is now a template.

Merge remote-tracking branch 'origin/dev' into mg_refactor_network

Merged bolt_serializer.cpp into hpp.

Removed obsolete include.

Initial version of bolt session unit test.

Uncommented leftover log commands.

Reimplemented io::Socket.

Added client-stress.sh script.

Reviewers: dgleich, buda

Reviewed By: dgleich, buda

Subscribers: pullbot, mferencevic, buda

Differential Revision: https://phabricator.memgraph.io/D64
2017-03-06 13:52:34 +01:00

35 lines
756 B
Bash
Executable File

#!/bin/bash
NUM_PARALLEL=4
if [[ "$1" != "" ]]; then
NUM_PARALLEL=$1
fi
for i in $( seq 1 $NUM_PARALLEL ); do
echo "CREATE (n {name: 29383}) RETURN n;" | neo4j-client --insecure --username= --password= neo4j://localhost:7687 >/dev/null 2>/dev/null &
done
running="yes"
count=0
while [[ "$running" != "" ]]; do
running=$( pidof neo4j-client )
num=$( echo "$running" | wc -w )
echo "Running clients: $num"
count=$(( count + 1 ))
if [[ $count -gt 5 ]]; then break; fi
sleep 1
done
if [[ "$running" != "" ]]; then
echo "Something went wrong!"
echo "Running PIDs: $running"
echo "Killing leftover clients..."
kill -9 $running >/dev/null 2>/dev/null
wait $running 2>/dev/null
else
echo "All ok!"
fi