Skip to content
Myr

graph

This file

Path

benchmarks/graph

82 lines · 1.6 KiB

Last changed by

Merge branch 'benchmarks'visionmediabefore adoptionc01a7f5

History of this file

Take it

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

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

Merge branch 'benchmarks'visionmediabefore adoption3c150db

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

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

line 5why, one step back
5#

Merge branch 'benchmarks'visionmediabefore adoption3c150db

lines 6–15why, one step back
6# <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 back
16# <title> <node> <express> <sinatra>
17#18

Merge branch 'benchmarks'visionmediabefore adoption3c150db

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

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

lines 20–26why, one step back
20 cat <<-EOF
21set terminal png22set output "benchmarks/graphs/$1.png"23set title "$1"24set size 1,0.725set grid y26set key left top

Merge branch 'benchmarks'visionmediabefore adoptionc01a7f5

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

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

lines 29–34why, one step back
29plot "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}34

Merge branch 'benchmarks'visionmediabefore adoption3c150db

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

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

lines 54–56why, one step back
54mkdir -p benchmarks/graphs
5556for type in simple static static.large; do

Merge branch 'benchmarks'visionmediabefore adoption3c150db

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

Merge branch 'benchmarks'visionmediabefore adoptione2fe603

line 80why, one step back
80done

Merge branch 'benchmarks'visionmediabefore adoption3c150db

lines 81–82why, one step back
81
82rm benchmarks/graphs/*.p