Authored by Rong

add

  1 +#!/bin/bash
  2 +
  3 +basepath=$(cd `dirname $0`; pwd)
  4 +
  5 +ps -ef | grep "yohoPerformanceTestAuto_Job.sh" | grep -v grep | cut -c 9-15 | xargs kill -9
  6 +
  7 +if [ "$1" == "stop" ];then
  8 +exit
  9 +fi
  10 +${basepath}/yohoPerformanceTestAuto_Job.sh 1>/dev/null 2>&1 &
  1 +#!/bin/bash
  2 +if [ -f ~/.bash_profile ];
  3 +then
  4 + . ~/.bash_profile
  5 +fi
  6 +
  7 +if [[ ! $1 ]];then
  8 + echo "not input tc_name"
  9 + exit 1
  10 +fi
  11 +
  12 +INFLUXDB_IP=192.168.104.43
  13 +INFLUXDB_DB=jmeter
  14 +
  15 +TC_NAME=$1
  16 +GOR_LOG_PATH=/Data/logs/jmeter/gor.log
  17 +
  18 +IP=$(/sbin/ip addr show | grep eth | grep inet | awk '{print $2}' | awk -F '/' '{print $1}')
  19 +
  20 +function exeInfluxdb(){
  21 + curl -XPOST "http://${INFLUXDB_IP}:8086/write?db=${INFLUXDB_DB}" --data-binary "$1"
  22 +}
  23 +
  24 +function uploadLoadInfo(){
  25 + v1=$(cat ${GOR_LOG_PATH} | grep output_http | tail -n 1 | awk -F ',' '{print $2}')
  26 + v2=$(cat ${GOR_LOG_PATH} | grep output_http | tail -n 1 | awk -F ',' '{print $5}')
  27 + exeInfluxdbStr="${IP}.${TC_NAME}.ok.count value=${v1}
  28 +${IP}.${TC_NAME}.ok.pct90 value=${v2}"
  29 + exeInfluxdb "$exeInfluxdbStr"
  30 +}
  31 +
  32 +uploadLoadInfo
  33 +
  1 +#!/bin/bash
  2 +if [ -f ~/.bash_profile ];
  3 +then
  4 + . ~/.bash_profile
  5 +fi
  6 +
  7 +basepath=$(cd `dirname $0`; pwd)
  8 +
  9 +while true
  10 +do
  11 +${basepath}/yohoPerformanceTestAuto_Gor_InfluxDB.sh
  12 +
  13 +sleep 7
  14 +done