Authored by Rong

add

#!/bin/bash
basepath=$(cd `dirname $0`; pwd)
ps -ef | grep "yohoPerformanceTestAuto_Job.sh" | grep -v grep | cut -c 9-15 | xargs kill -9
if [ "$1" == "stop" ];then
exit
fi
${basepath}/yohoPerformanceTestAuto_Job.sh 1>/dev/null 2>&1 &
... ...
#!/bin/bash
if [ -f ~/.bash_profile ];
then
. ~/.bash_profile
fi
if [[ ! $1 ]];then
echo "not input tc_name"
exit 1
fi
INFLUXDB_IP=192.168.104.43
INFLUXDB_DB=jmeter
TC_NAME=$1
GOR_LOG_PATH=/Data/logs/jmeter/gor.log
IP=$(/sbin/ip addr show | grep eth | grep inet | awk '{print $2}' | awk -F '/' '{print $1}')
function exeInfluxdb(){
curl -XPOST "http://${INFLUXDB_IP}:8086/write?db=${INFLUXDB_DB}" --data-binary "$1"
}
function uploadLoadInfo(){
v1=$(cat ${GOR_LOG_PATH} | grep output_http | tail -n 1 | awk -F ',' '{print $2}')
v2=$(cat ${GOR_LOG_PATH} | grep output_http | tail -n 1 | awk -F ',' '{print $5}')
exeInfluxdbStr="${IP}.${TC_NAME}.ok.count value=${v1}
${IP}.${TC_NAME}.ok.pct90 value=${v2}"
exeInfluxdb "$exeInfluxdbStr"
}
uploadLoadInfo
... ...
#!/bin/bash
if [ -f ~/.bash_profile ];
then
. ~/.bash_profile
fi
basepath=$(cd `dirname $0`; pwd)
while true
do
${basepath}/yohoPerformanceTestAuto_Gor_InfluxDB.sh
sleep 7
done
... ...