Skip to content

Instantly share code, notes, and snippets.

@tomgco
Created April 10, 2013 16:40
Show Gist options
  • Save tomgco/5356291 to your computer and use it in GitHub Desktop.
Save tomgco/5356291 to your computer and use it in GitHub Desktop.
Apache-bench graphs
#!/bin/bash
NAME=$1
# node ../../PersonalSite/app.js &
pid=$!
bench() {
ab -n 6000 -c 40 -g out-$NAME.graph -H "Accept-Encoding: gzip" "http://127.0.0.1:3021/main/js/lib/v0.1.0/jquery-1.7.2.min.js"
}
sleep 2
bench
#killall node
# output as png image
set terminal png
# save file to "out.png"
set output "out.png"
#change the size of the outputted png
set terminal png size 1000,600
# graph title
set title "ab -n 8000 -c 100"
# nicer aspect ratio for image size
set size 1,1
# y-axis grid
set grid y
# x-axis label
set xlabel "request"
# y-axis label
set ylabel "response time (ms)"
# plot data from "out.dat" using column 9 with smooth sbezier lines
# and title of "nodejs" for the given data
plot "out-none.graph" using 9 smooth sbezier with lines title "without",
"out-0.0.X.graph" using 9 smooth sbezier with lines title "0.0.X",
"out-old.graph" using 9 smooth sbezier with lines title "0.1.X",
"out-new.graph" using 9 smooth sbezier with lines title "0.2.X",
"out-cluster-new.graph" using 9 smooth sbezier with lines title "cluster-0.2.X",
"out-cluster-old.graph" using 9 smooth sbezier with lines title "cluster-0.1.X",
"out-0.2.2.graph" using 9 smooth sbezier with lines title "latest"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment