graph
This file
Path
benchmarks/graph
82 lines · 1.6 KiB
Last changed by
Merge branch 'benchmarks'visionmediabefore adoptionc01a7f5
History of this fileTake it
Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 1–3why, one step back1#!/usr/bin/env bash23#Merge branch 'benchmarks'visionmediabefore adoption3c150db
line 4why, one step back4# Log <msg ...>Merge branch 'benchmarks'visionmediabefore adoptione2fe603
line 5why, one step back5# Merge branch 'benchmarks'visionmediabefore adoption3c150db
lines 6–15why, one step back6# <msg ...>7#89log(){10 echo "... $@"11}1213#14# Output gnuplot script for line graph.15# Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 16–18why, one step back16# <title> <node> <express> <sinatra>17#18Merge branch 'benchmarks'visionmediabefore adoption3c150db
line 19why, one step back19function line() {Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 20–26why, one step back20 cat <<-EOF21set terminal png22set output "benchmarks/graphs/$1.png"23set title "$1"24set size 1,0.725set grid y26set key left topMerge branch 'benchmarks'visionmediabefore adoptionc01a7f5
lines 27–28why, one step back27set xlabel "request"28set ylabel "response time (ms)"Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 29–34why, one step back29plot "benchmarks/$2" using 10 with lines title "node", \\30 "benchmarks/$3" using 10 with lines title "express", \\31 "benchmarks/$4" using 10 with lines title "sinatra thin"32EOF33}34Merge branch 'benchmarks'visionmediabefore adoption3c150db
lines 35–53why, one step back35#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}53Merge branch 'benchmarks'visionmediabefore adoptione2fe603
lines 54–56why, one step back54mkdir -p benchmarks/graphs5556for type in simple static static.large; doMerge branch 'benchmarks'visionmediabefore adoption3c150db
lines 57–79why, one step back57 plot=benchmarks/graphs/$type.p58 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 $plotMerge branch 'benchmarks'visionmediabefore adoptione2fe603
line 80why, one step back80doneMerge branch 'benchmarks'visionmediabefore adoption3c150db
lines 81–82why, one step back8182rm benchmarks/graphs/*.p