Added graphing capabilities (gnuplot must be installed)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 2dc5afd · Browse files · 10 files·+68 added−37 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
10 files+68 added−37 removed
- other:+68 added−37 removed
Provenance
- Commit
59c4e35- Tree
3f6231c- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
2dc5afd
10 files changed+68 added−37 removed
modified:benchmarks/thin/simple.ru+4 added-4 removed
1 2 require 'rubygems'3-require 'rack'3+require 'sinatra'4 5-app = lambda do |env|6- [200, { 'Content-Type' => 'text/plain' }, 'Hello World']5+get '/' do6+ 'Hello World'7 end8 9-run app9+run Sinatra::Applicationdeleted:benchmarks/thin/simple.sinatra.ru-9 removed
1-2-require 'rubygems'3-require 'sinatra'4-5-get '/' do6- 'Hello World'7-end8-9-run Sinatra::Applicationadded:benchmarks/thin/static.large.ru+9 added
1+2+require 'rubygems'3+require 'sinatra'4+5+get '/' do6+ send_file 'benchmarks/shared/huge.js'7+end8+9+run Sinatra::Applicationadded:benchmarks/thin/static.ru+9 added
1+2+require 'rubygems'3+require 'sinatra'4+5+get '/' do6+ send_file 'benchmarks/shared/jquery.js'7+end8+9+run Sinatra::Applicationdeleted:benchmarks/thin/static.sinatra.large.ru-9 removed
1-2-require 'rubygems'3-require 'sinatra'4-5-get '/' do6- send_file 'benchmarks/shared/huge.js'7-end8-9-run Sinatra::Applicationdeleted:benchmarks/thin/static.sinatra.ru-9 removed
1-2-require 'rubygems'3-require 'sinatra'4-5-get '/' do6- send_file 'benchmarks/shared/jquery.js'7-end8-9-run Sinatra::Applicationadded:benchmarks/graph+35 added
1+#!/usr/bin/env bash2+3+#4+# Output gnuplot script.5+# 6+# <title> <node> <express> <sinatra>7+#8+9+function plot() {10+ cat <<-EOF11+set terminal png12+set output "benchmarks/graphs/$1.png"13+set title "$1"14+set size 1,0.715+set grid y16+set key left top17+set xlabel "request percentage"18+set xlabel "response time (ms)"19+plot "benchmarks/$2" using 10 with lines title "node", \\20+ "benchmarks/$3" using 10 with lines title "express", \\21+ "benchmarks/$4" using 10 with lines title "sinatra thin"22+EOF23+}24+25+mkdir -p benchmarks/graphs26+27+for type in simple static static.large; do28+ echo ... generating benchmarks/graphs/$type.png29+ plot $type \30+ express/$type.js.plot \31+ node/$type.js.plot \32+ thin/$type.ru.plot \33+ > benchmarks/graphs/$type.p34+ gnuplot benchmarks/graphs/$type.p35+donemodified:benchmarks/run+3 added-4 removed
38 unmodified lines39 ;;40 esac41 pid=$!42 sleep $SLEEP43- $AB $ABFLAGS -e benchmarks/$type/$file.csv $ADDR > benchmarks/$type/$file.out43+ $AB $ABFLAGS -g benchmarks/$type/$file.plot $ADDR > benchmarks/$type/$file.out44 log $(cat benchmarks/$type/$file.out | grep Requests)45 kill -KILL $pid46 }47 4 unmodified lines52 bm express simple.js53 bm express static.js54 bm express static.large.js55 bm thin simple.ru56-bm thin simple.sinatra.ru57-bm thin static.sinatra.ru58-bm thin static.sinatra.large.ru56+bm thin static.ru57+bm thin static.large.rumodified:.gitignore+3 added-1 removed
1 .DS_Store2 *.seed3 *.log4 *.csv5-*.out5+*.plot6+*.out7+benchmarks/graphsmodified:Makefile+5 added-1 removed
33 unmodified lines34 @$(COFFEE) examples/coffee-upload/app.coffee35 36 benchmark: benchmarks/run37 @./benchmarks/run38+ @./benchmarks/graph39 40+graphs:41+ @./benchmarks/graph42+39-.PHONY: install test app43+.PHONY: install test app benchmark graphs