X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Fscripts%2Foperation_tps.sh;fp=example%2Fdiameter%2Flauncher%2Fresources%2Fscripts%2Foperation_tps.sh;h=0000000000000000000000000000000000000000;hb=c881c12ed7e116f1d43760a0d9873f860c10a357;hp=3c5d7ffad2577dc00e3951c5f67307700c94d835;hpb=af14877201a9856708ec43086a229777d9cb3da7;p=anna.git diff --git a/example/diameter/launcher/resources/scripts/operation_tps.sh b/example/diameter/launcher/resources/scripts/operation_tps.sh deleted file mode 100755 index 3c5d7ff..0000000 --- a/example/diameter/launcher/resources/scripts/operation_tps.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - echo " sendXS [amount: default -1 (no limit)]:" - echo " send messages from burst list with the TPS provided. User could hot change" - echo " speed by mean 'echo > .tps' at another shell. You can stop the load" - echo " removing that hidden file or using CTRL+C from the shell where you launched" - echo " the burst command. Real tps is dumped on '.real_tps' file during testing." - echo " You could limit the amount of messages sent by mean the second parameter." - echo " No limit is established by default (-1 or negative value)." -> curl_log.txt -TRACE="--trace-ascii curl_log.txt" -SERVER=`cat .httpServer` - -use () { - - echo "Use: $0 [2c]" - echo - echo "Sends 'xml_file' to the diameter server or to the client when '2c' parameter is provided." - echo - exit -} - - sendXS) [[ "$2" = "" ]] && uso - limit=$3 - [[ "$limit" = "" ]] && limit=-1 - entero $2 - entero $limit - TPS=0 - count=0 - amount=1 - echo $2 > .tps - while test -f .tps - do - [[ "$count" = "$limit" ]] && break - BEFORE_ns=`date +%s%N` - READ_TPS=`cat .tps` - # Hot change could make .tps still unavailable: - [[ "$READ_TPS" = "" ]] && READ_TPS=$TPS - # Volvemos a calcular medias (REAL_TPS) cada 10 segundos o cuando cambia el TPS en caliente: - [[ "$READ_TPS" != "$TPS" ]] && { BEGIN_ns=$BEFORE_ns ; count=0 ; } - [[ $count = $((10*TPS)) ]] && { BEGIN_ns=$BEFORE_ns ; count=0 ; } - TPS=$READ_TPS - [[ "$TPS" = "0" ]] && salir "Test stopped due to 0-tps value read" - # Background: - _curl "burst|send|$amount" & - count=$((count+amount)) - AFTER_ns=`date +%s%N` - # Real tps: - REAL_TPS=$(calc "1000000000 * $count / ($AFTER_ns - $BEGIN_ns)") - echo $REAL_TPS > .real_tps - - COEF=1 - [[ $(calc "$TPS > $REAL_TPS") = "1" ]] && COEF=$(calc "$REAL_TPS / $TPS") - K=$(calc "$COEF ^ 10") - amount=$(calc "scale=0;1/$K") - usleep $(calc "$K * 1000000/$TPS") - done - ;; -echo -[[ "$1" = "" ]] && use -[[ ! -f "$1" ]] && { echo "ERROR: file '$1' not found" ; echo; echo; exit ; } -echo -operation="sendxml2e|$1" -[[ "$2" = "2c" ]] && operation="sendxml2c|$1" - -curl -m 1 --data "$operation" $TRACE ${SERVER} -