Skip to content

Instantly share code, notes, and snippets.

@anak10thn
Created March 31, 2015 14:08
Show Gist options
  • Select an option

  • Save anak10thn/70df5b60b825a13203bc to your computer and use it in GitHub Desktop.

Select an option

Save anak10thn/70df5b60b825a13203bc to your computer and use it in GitHub Desktop.
porcupine
#!/bin/bash
#script directory label
DIR=`pwd`"/"$1
if [ -d $DIR ]
then
PT=$DIR
else
echo "Directory not exist"
exit 0
fi
DATE=`date +%Y%m%d`
TIME=`date +%T | sed s/:/-/g`
LABEL=$2
PLOT=""
mkdir -p bench/$DATE/plot
touch bench/$DATE/plot/$DATE$TIME
ls $PT*.dat >bench/$DATE/plot/$DATE$TIME-file.txt
while read line
do
NFILE=`basename $line`
PLOT+="\"$line\" using 9 smooth sbezier with lines title \"$NFILE\"*"
done < bench/$DATE/plot/$DATE$TIME-file.txt
DPLOT=`echo $PLOT|sed s/*/,/g`
cat > bench/$DATE/plot/$DATE$TIME <<EOF
set terminal png
set output "bench/$DATE/$LABEL-$DATE$TIME.png"
set title "$LABEL"
set size 1,0.7
set grid y
set xlabel "request"
set ylabel "response time (ms)"
plot $DPLOT
EOF
gnuplot bench/$DATE/plot/$DATE$TIME
#!/bin/bash
#script directory label
DIR=`pwd`"/"$1
if [ -d $DIR ]
then
PT=$DIR
else
echo "Directory not exist"
exit 0
fi
DATE=`date +%Y%m%d`
TIME=`date +%T | sed s/:/-/g`
LABEL=$2
PLOT=""
mkdir -p bench/$DATE/plot
touch bench/$DATE/plot/$DATE$TIME
ls $PT*.dat >bench/$DATE/plot/$DATE$TIME-file.txt
while read line
do
NFILE=`basename $line`
PLOT+="\"$line\" using 9 smooth sbezier with lines title \"$NFILE\"*"
done < bench/$DATE/plot/$DATE$TIME-file.txt
DPLOT=`echo $PLOT|sed s/*/,/g`
cat > bench/$DATE/plot/$DATE$TIME <<EOF
set terminal canvas
set output "bench/$DATE/$LABEL-$DATE$TIME.html"
set title "$LABEL"
set size 1,0.7
set grid y
set xlabel "request"
set ylabel "response time (ms)"
plot $DPLOT
EOF
gnuplot bench/$DATE/plot/$DATE$TIME
#!/bin/bash
#script n c google.com/ google
N=$1
C=$2
LABEL=$4
DATE=`date +%Y%m%d`
TIME=`date +%T | sed s/:/-/g`
URL='http://'$3
mkdir -p data/$DATE/plot
touch data/$DATE/plot/$DATE$TIME
ab -n $N -c $C -g data/$DATE/$LABEL$DATE$TIME.dat $URL
cat > data/$DATE/plot/$DATE$TIME <<EOF
set terminal png
set output "data/$DATE/$LABEL$DATE$TIME.png"
set title "ab -n $N -c $C $URL"
set size 1,0.7
set grid y
set xlabel "request"
set ylabel "response time (ms)"
plot "data/$DATE/$LABEL$DATE$TIME.dat" using 9 smooth sbezier with lines title "something"
EOF
gnuplot data/$DATE/plot/$DATE$TIME
#!/bin/bash
#script n c google.com/ google
N=$1
C=$2
LABEL=$4
DATE=`date +%Y%m%d`
TIME=`date +%T | sed s/:/-/g`
URL=$3
mkdir -p data/$DATE/plot
touch data/$DATE/plot/$DATE$TIME
ab -n $N -c $C -g data/$DATE/$LABEL$DATE$TIME.dat $URL
cat > data/$DATE/plot/$DATE$TIME <<EOF
set terminal canvas
set output "data/$DATE/$LABEL$DATE$TIME.html"
set title "ab -n $N -c $C $URL"
set size 1,0.7
set grid y
set xlabel "request"
set ylabel "response time (ms)"
plot "data/$DATE/$LABEL$DATE$TIME.dat" using 9 smooth sbezier with lines title "something"
EOF
gnuplot data/$DATE/plot/$DATE$TIME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment