This repository has been archived by the owner on Feb 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
graph
executable file
·84 lines (71 loc) · 1.48 KB
/
graph
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
# based on http://github.com/senchalabs/connect/tree/master/benchmarks/
COL=${COL-9}
ABFLAGS=$(cat results/flags)
# Log <msg ...>
#
# <msg ...>
#
log(){
echo "... $@"
}
#
# Output gnuplot script for line graph.
#
# <title> <node> <connect>
#
function line() {
cat <<-EOF
set terminal png # enhanced size 600 380 fname "Sans" fsize 11
set output "results/graphs/$1.png"
set title "$2 ($ABFLAGS)"
# set size 0.97,0.97
set grid y
set key left top
set xlabel "requests"
set ylabel "response time (ms)"
plot "$3" using $COL smooth sbezier with lines title "common", \\
"$4" using $COL smooth sbezier with lines title "connect", \\
"$5" using $COL smooth sbezier with lines title "ringo"
EOF
}
#
# Output gnuplot script for bar graph.
#
# <title> <node> <connect>
#
function bar() {
cat <<-EOF
set terminal png
set output "results/graphs/$1.rps.png"
set title "$1 $ABFLAGS"
set size 0.7,0.5
set grid y
set key left top
set ylabel "requests per second"
plot "$1.rps.dat" using 2: xtic(1) with histogram title ""
EOF
}
#
# Graph the output of the given <dir>.
#
# <dir>
#
function graph(){
log graphing $1
local dir=results/$1
line $1 "$2" \
$dir/common-node.dat \
$dir/node.dat \
$dir/ringo.dat \
> results/$1.p
gnuplot results/$1.p
}
# Make ./results/graphs
mkdir -p results/graphs
graph buffer-alloc "buffer alloc"
graph hello-world "hello world"
graph no-alloc "no alloc"
graph parse-json "parse json"
graph static-file "static file"
graph string-alloc "string alloc"