Skip to content
Myr

Added graphing capabilities (gnuplot must be installed)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 2dc5afd · Browse files · 10 files+68 added−37 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

10 files+68 added−37 removed

  • other:+68 added−37 removed

10 files+68 added−37 removed

modified:benchmarks/thin/simple.ru+4 added-4 removed
12require 'rubygems'3require 'rack'3require 'sinatra'45app = lambda do |env|6 [200, { 'Content-Type' => 'text/plain' }, 'Hello World']5get '/' do6 'Hello World'7end89run app9run Sinatra::Application
deleted:benchmarks/thin/simple.sinatra.ru-9 removed
12require 'rubygems'3require 'sinatra'45get '/' do6 'Hello World'7end89run Sinatra::Application
added:benchmarks/thin/static.large.ru+9 added
12require 'rubygems'3require 'sinatra'45get '/' do6 send_file 'benchmarks/shared/huge.js'7end89run Sinatra::Application
added:benchmarks/thin/static.ru+9 added
12require 'rubygems'3require 'sinatra'45get '/' do6 send_file 'benchmarks/shared/jquery.js'7end89run Sinatra::Application
deleted:benchmarks/thin/static.sinatra.large.ru-9 removed
12require 'rubygems'3require 'sinatra'45get '/' do6 send_file 'benchmarks/shared/huge.js'7end89run Sinatra::Application
deleted:benchmarks/thin/static.sinatra.ru-9 removed
12require 'rubygems'3require 'sinatra'45get '/' do6 send_file 'benchmarks/shared/jquery.js'7end89run Sinatra::Application
added:benchmarks/graph+35 added
1#!/usr/bin/env bash23#4# Output gnuplot script.5# 6# <title> <node> <express> <sinatra>7#89function plot() {10 cat <<-EOF11set terminal png12set output "benchmarks/graphs/$1.png"13set title "$1"14set size 1,0.715set grid y16set key left top17set xlabel "request percentage"18set xlabel "response time (ms)"19plot "benchmarks/$2" using 10 with lines title "node", \\20 "benchmarks/$3" using 10 with lines title "express", \\21 "benchmarks/$4" using 10 with lines title "sinatra thin"22EOF23}2425mkdir -p benchmarks/graphs2627for type in simple static static.large; do28 echo ... generating benchmarks/graphs/$type.png29 plot $type \30 express/$type.js.plot \31 node/$type.js.plot \32 thin/$type.ru.plot \33 > benchmarks/graphs/$type.p34 gnuplot benchmarks/graphs/$type.p35done
modified:benchmarks/run+3 added-4 removed
38 unmodified lines
39 ;;40 esac41 pid=$!42 sleep $SLEEP43 $AB $ABFLAGS -e benchmarks/$type/$file.csv $ADDR > benchmarks/$type/$file.out43 $AB $ABFLAGS -g benchmarks/$type/$file.plot $ADDR > benchmarks/$type/$file.out44 log $(cat benchmarks/$type/$file.out | grep Requests)45 kill -KILL $pid46}47
4 unmodified lines
52bm express simple.js53bm express static.js54bm express static.large.js55bm thin simple.ru56bm thin simple.sinatra.ru57bm thin static.sinatra.ru58bm thin static.sinatra.large.ru56bm thin static.ru57bm thin static.large.ru
modified:.gitignore+3 added-1 removed
1.DS_Store2*.seed3*.log4*.csv5*.out5*.plot6*.out7benchmarks/graphs
modified:Makefile+5 added-1 removed
33 unmodified lines
34 @$(COFFEE) examples/coffee-upload/app.coffee3536benchmark: benchmarks/run37 @./benchmarks/run38 @./benchmarks/graph3940graphs:41 @./benchmarks/graph4239.PHONY: install test app43.PHONY: install test app benchmark graphs