X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fdeployments%2Fst-client%2Fprogram.sh;h=07e76169b365bc65b02622adc602b059147b1ebe;hp=030877134b9fa83e4b4fcb71676d3d8bfe5d7d7c;hb=b8a974c5eaba39f0891dfd17b64f7dd6411688dc;hpb=5e6cbe34594884c65483235a5d782fe5717cdce6 diff --git a/example/diameter/launcher/deployments/st-client/program.sh b/example/diameter/launcher/deployments/st-client/program.sh index 0308771..07e7616 100755 --- a/example/diameter/launcher/deployments/st-client/program.sh +++ b/example/diameter/launcher/deployments/st-client/program.sh @@ -40,13 +40,6 @@ usage() { _exit } -children () { - bash_pid=$$ - children=`ps -eo ppid | grep -w $bash_pid` - echo $children | wc -w -} - - ############# # EXECUTION # ############# @@ -60,7 +53,10 @@ miss_conf= echo [ -z "$1" ] && usage -./operation.sh --ping +echo "Starting testcases programming ..." +echo + +./operation.sh --ping >/dev/null [ $? -ne 0 ] && _exit "Programming aborted (some ADML client process is not running) !" TESTCASE_DIR=$1 AUTOSTART=$2 @@ -76,25 +72,39 @@ CLONE_GROUPS=$((MAX_NUMBER_GROUPS/ADML_INSTANCES)) specific= [ -f $TESTCASE_DIR/specific ] && specific=specific -children_before=$(children) +[ -z "$ADML_CONCURRENT_PROVISION_JOBS" ] && ADML_CONCURRENT_PROVISION_JOBS=5 + +count=0 while read -r line do instance=$(echo $line | awk '{ print $1 }') ini_seq=$(echo $line | awk '{ print $2 }') fin_seq=$(echo $line | awk '{ print $3 }') ADML_DIR=`readlink -f ADMLS/ADML-$instance` + echo -e "\rCloning interval [$ini_seq,$fin_seq] for $(basename $ADML_DIR) ..." ./clone.sh $ADML_DIR $TESTCASE $ini_seq $fin_seq $CLONE_GROUPS $specific & + sleep 0.1 + count=$((count+1)) + if [ $count -eq $ADML_CONCURRENT_PROVISION_JOBS ] + then + idle_cpu=$(top -b -d 0.1 -n 2 | grep 'Cpu(s):'| tail -1 |awk '{print $8}') + echo + echo "Idle cpu = $idle_cpu%" + echo "if cpu is not overcommited, consider increase ADML_CONCURRENT_PROVISION_JOBS environment variable (now $ADML_CONCURRENT_PROVISION_JOBS)" + echo + wait $(jobs -p) + count=0 + fi done < $PROGRAM_LAYOUT_FILE # Wait background jobs to finish: -sleep 1 +sleep 5 echo "Waiting for clone completion ..." -while true -do - [ $(children) -eq $children_before ] && break - sleep 1 -done +echo "(please be patient, this may take a while)" +echo +echo "Background Jobs: $(jobs -p | wc -l)" +wait $(jobs -p) echo echo "Programming has finished !" @@ -129,6 +139,9 @@ else else echo "Remember that you could start traffic using:" echo " ./operation.sh \"test|ttps|\"" + echo + echo "For example, to reach $DESIRED_RATE test cases per second:" + echo " ./operation.sh \"test|ttps|$RATE_PER_INSTANCE\"" fi fi