Skip to content
Myr

graph

This file

Path

benchmarks/graph

84 lines · 1.7 KiB

Last changed by

Merge branch 'master' of http://github.com/visionmedia/expressGuillermo Rauchbefore adoption8ef6a0b

History of this file

Take it

1#!/usr/bin/env bash23COL=${COL-9}45#6# Log <msg ...>7# 8# <msg ...>9#1011log(){12  echo "... $@"13}1415#16# Output gnuplot script for line graph.17# 18# <title> <node> <express> <sinatra>19#2021function line() {22  cat <<-EOF23set terminal png24set output "benchmarks/graphs/$1.png"25set title "$1"26set size 1,0.727set grid y28set key left top29set xlabel "request"30set ylabel "response time (ms)"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"34EOF35}3637#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}5556mkdir -p benchmarks/graphs5758for type in simple haml sass static static.large; do59  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 $plot82done8384rm benchmarks/graphs/*.p