graph
This file
Path
benchmarks/graph
84 lines · 1.7 KiB
Last changed by
Merge branch 'benchmarks'visionmediabefore adoption71e97c8
History of this fileTake it
Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 1–2why, one step back1#!/usr/bin/env bash2Merge branch 'benchmarks'visionmediabefore adoption7ef13ea
lines 3–4why, one step back3COL=${COL-9}4Merge branch 'benchmarks'visionmediabefore adoptione2fe603
line 5why, one step back5#Merge branch 'benchmarks'visionmediabefore adoption3c150db
line 6why, one step back6# Log <msg ...>Merge branch 'benchmarks'visionmediabefore adoptione2fe603
line 7why, one step back7# Merge branch 'benchmarks'visionmediabefore adoption3c150db
lines 8–17why, one step back8# <msg ...>9#1011log(){12 echo "... $@"13}1415#16# Output gnuplot script for line graph.17# Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 18–20why, one step back18# <title> <node> <express> <sinatra>19#20Merge branch 'benchmarks'visionmediabefore adoption3c150db
line 21why, one step back21function line() {Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 22–28why, one step back22 cat <<-EOF23set terminal png24set output "benchmarks/graphs/$1.png"25set title "$1"26set size 1,0.727set grid y28set key left topMerge branch 'benchmarks'visionmediabefore adoptionc01a7f5
lines 29–30why, one step back29set xlabel "request"30set ylabel "response time (ms)"Smooth line graphvisionmediabefore adoptionc9d79f2
lines 31–33why, one step back31plot "benchmarks/$2" using $COL smooth sbezier with lines title "node", \\32 "benchmarks/$3" using $COL smooth sbezier with lines title "express", \\33 "benchmarks/$4" using $COL smooth sbezier with lines title "sinatra thin"Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 34–36why, one step back34EOF35}36Merge branch 'benchmarks'visionmediabefore adoption3c150db
lines 37–55why, one step back37#38# Output gnuplot script for bar graph.39# 40# <title> <node> <express> <sinatra>41#4243function bar() {44cat <<-EOF45set terminal png46set output "benchmarks/graphs/$1.rps.png"47set title "$1"48set size 0.7,0.549set grid y50set key left top51set ylabel "requests per second"52plot "benchmarks/$1.rps.dat" using 2: xtic(1) with histogram title ""53EOF54}55Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 56–57why, one step back56mkdir -p benchmarks/graphs57Merge branch 'benchmarks'visionmediabefore adoption71e97c8
line 58why, one step back58for type in simple haml sass static static.large; doMerge branch 'benchmarks'visionmediabefore adoption3c150db
lines 59–81why, one step back59 plot=benchmarks/graphs/$type.p60 log generating benchmarks/graphs/$type.png61 line $type \62 node/$type.js.dat \63 express/$type.js.dat \64 thin/$type.ru.dat \65 > $plot66 gnuplot $plot67 68 log generating benchmarks/graphs/$type.rps.png69 plot=benchmarks/graphs/$type.rps.p70 dat=benchmarks/$type.rps.dat71 :> $dat72 for server in node express thin; do73 case $server in74 node|express) ext=js ;;75 thin) ext=ru ;;76 esac77 rps=$(cat benchmarks/$server/$type.$ext.out | grep "Requests per second:" | awk '{ print $4 }')78 echo $server $rps >> $dat79 done80 bar $type > $plot81 gnuplot $plotMerge branch 'benchmarks'visionmediabefore adoptione2fe603
line 82why, one step back82doneMerge branch 'benchmarks'visionmediabefore adoption3c150db
lines 83–84why, one step back8384rm benchmarks/graphs/*.p