From e03af6fc94991728776bc7a027aa22f520875de4 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Nikolov Date: Thu, 22 Aug 2013 10:29:09 +0300 Subject: [PATCH] Add a simple shell script for simulating requests --- src/request-simulator.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/request-simulator.sh diff --git a/src/request-simulator.sh b/src/request-simulator.sh new file mode 100644 index 0000000..4805cf5 --- /dev/null +++ b/src/request-simulator.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Max number of concurent requests +MAX_REQUESTS=16 + +# Total number of requests to be made +TOTAL_REQUESTS=1000 + +let i=0 +while [[ ${i} -lt ${TOTAL_REQUESTS} ]]; do + running=$( ps -ef | grep vm-pollerd-client | grep -v grep | wc -l ) + + # Fire up another request if needed + if [[ ${running} -lt ${MAX_REQUESTS} ]]; then + echo "Firing up another request ..." + ./vm-pollerd-client -D -n esx1-evn1_local0 -p summary.capacity -u ds:///vmfs/volumes/4c68dc48-0db9ca38-f0e0-78e7d1e5782e/ -c poll -V vc1-sof2 & + fi +done