Skip to content
Myr

graph

This file

Path

benchmarks/graph

84 lines · 1.7 KiB

Last changed by

Merge branch 'benchmarks'visionmediabefore adoption71e97c8

History of this file

Take it

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

lines 1–2why, one step back
1#!/usr/bin/env bash
2

Merge branch 'benchmarks'visionmediabefore adoption7ef13ea

lines 3–4why, one step back
3COL=${COL-9}
4

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

line 5why, one step back
5#

Merge branch 'benchmarks'visionmediabefore adoption3c150db

line 6why, one step back
6# Log <msg ...>

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

line 7why, one step back
7#

Merge branch 'benchmarks'visionmediabefore adoption3c150db

lines 8–17why, one step back
8# <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 back
18# <title> <node> <express> <sinatra>
19#20

Merge branch 'benchmarks'visionmediabefore adoption3c150db

line 21why, one step back
21function line() {

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

lines 22–28why, one step back
22 cat <<-EOF
23set terminal png24set output "benchmarks/graphs/$1.png"25set title "$1"26set size 1,0.727set grid y28set key left top

Merge branch 'benchmarks'visionmediabefore adoptionc01a7f5

lines 29–30why, one step back
29set xlabel "request"
30set ylabel "response time (ms)"

Smooth line graphvisionmediabefore adoptionc9d79f2

lines 31–33why, one step back
31plot "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 back
34EOF
35}36

Merge branch 'benchmarks'visionmediabefore adoption3c150db

lines 37–55why, one step back
37#
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}55

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

lines 56–57why, one step back
56mkdir -p benchmarks/graphs
57

Merge branch 'benchmarks'visionmediabefore adoption71e97c8

line 58why, one step back
58for type in simple haml sass static static.large; do

Merge branch 'benchmarks'visionmediabefore adoption3c150db

lines 59–81why, one step back
59 plot=benchmarks/graphs/$type.p
60 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 $plot

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

line 82why, one step back
82done

Merge branch 'benchmarks'visionmediabefore adoption3c150db

lines 83–84why, one step back
83
84rm benchmarks/graphs/*.p