Skip to content
Myr

Merge branch 'benchmarks'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parents f8a61c6, e31f5d2 · Browse files · 3 files+59 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+59 added−12 removed

  • other:+59 added−12 removed

3 files+59 added−12 removed

modified:benchmarks/graph+57 added-10 removed
1#!/usr/bin/env bash23#4# Output gnuplot script.4# Log <msg ...>5# 6# <msg ...>7#89log(){10 echo "... $@"11}1213#14# Output gnuplot script for line graph.15# 16# <title> <node> <express> <sinatra>17#189function plot() {19function line() {20 cat <<-EOF21set terminal png22set output "benchmarks/graphs/$1.png"23set title "$1"
7 unmodified lines
31 "benchmarks/$4" using 10 with lines title "sinatra thin"32EOF33}3435#36# Output gnuplot script for bar graph.37# 38# <title> <node> <express> <sinatra>39#4041function bar() {42cat <<-EOF43set terminal png44set output "benchmarks/graphs/$1.rps.png"45set title "$1"46set size 0.7,0.547set grid y48set key left top49set ylabel "requests per second"50plot "benchmarks/$1.rps.dat" using 2: xtic(1) with histogram title ""51EOF52}5354mkdir -p benchmarks/graphs5556for type in simple static static.large; do57 plot=benchmarks/graphs/$type.p28 echo ... generating benchmarks/graphs/$type.png29 plot $type \30 node/$type.js.plot \31 express/$type.js.plot \32 thin/$type.ru.plot \33 > benchmarks/graphs/$type.p34 gnuplot benchmarks/graphs/$type.p35done58 log generating benchmarks/graphs/$type.png59 line $type \60 node/$type.js.dat \61 express/$type.js.dat \62 thin/$type.ru.dat \63 > $plot64 gnuplot $plot65 66 log generating benchmarks/graphs/$type.rps.png67 plot=benchmarks/graphs/$type.rps.p68 dat=benchmarks/$type.rps.dat69 :> $dat70 for server in node express thin; do71 case $server in72 node|express) ext=js ;;73 thin) ext=ru ;;74 esac75 rps=$(cat benchmarks/$server/$type.$ext.out | grep "Requests per second:" | awk '{ print $4 }')76 echo $server $rps >> $dat77 done78 bar $type > $plot79 gnuplot $plot80done8182rm benchmarks/graphs/*.p
modified:benchmarks/run+1 added-1 removed
38 unmodified lines
39 ;;40 esac41 pid=$!42 sleep $SLEEP43 $AB $ABFLAGS -g benchmarks/$type/$file.plot $ADDR > benchmarks/$type/$file.out43 $AB $ABFLAGS -g benchmarks/$type/$file.dat $ADDR > benchmarks/$type/$file.out44 log $(cat benchmarks/$type/$file.out | grep Requests)45 kill -KILL $pid46}47
10 unmodified lines
modified:.gitignore+1 added-1 removed
1.DS_Store2*.seed3*.log4*.csv5*.plot5*.dat6*.out7benchmarks/graphs