File: plot_mass.sh

package info (click to toggle)
spring 103.0%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 43,720 kB
  • ctags: 63,685
  • sloc: cpp: 368,283; ansic: 33,988; python: 12,417; java: 12,203; awk: 5,879; sh: 1,846; xml: 655; perl: 405; php: 211; objc: 194; makefile: 77; sed: 2
file content (72 lines) | stat: -rwxr-xr-x 1,592 bytes parent folder | download | duplicates (6)
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
#!/bin/bash

if [ $# -le 0 ]; then
	echo "Usage: $0 [[file1] file2 ...]"
	echo "Advanced usage: "
	echo "$0 ../../bench_results_*/data-{1,2,3,4}-cmd{0,1}.data"
	exit 1
fi
set -e

TESTRUNS=$1

echo $TESTRUNS

CMDS='
set terminal pngcairo enhanced size 1024,768
set xlabel "GameTime (in minutes)"
set xtics nomirror
set ytics nomirror
set border 3
#set xrange [0:20]
#set yrange [0:10]

outdir="./"

blend(x,a) = (avg = (avg == 0)? x: avg*a+x*(1-a), avg)
init(x) = (avg = 0)

#set key opaque invert box top left reverse Left
#set yrange [0:200]
set ylabel "FrameTime (in ms)"
set output outdir . "benchmark_total.png"
set label "60FPS" front  at screen 0.5, first 19  tc rgb "green"
set label "30FPS" front  at screen 0.5, first 36  tc rgb "black"
set label "15FPS" front  at screen 0.5, first 70  tc rgb "red"
plot avg=init(0)'

N=-1
for file in $@; do
	N=$((N +1))
	if [ ! -s $file ]; then
		echo "$file doesn't exist!"
		exit 1;
	fi
	DATAFILES="$DATAFILES datafile$N=\"$file\"
"
	CMDS="$CMDS, \\
		avg=init(0), datafile$N using (\$1/30/60):(blend(1000/\$2,0.9999)) with line title \"$N $(basename $file) .data\""
done

#CMDS="$CMDS, \
#"
CMDS="$CMDS,\\
datafile$N using (\$1/30/60):(16) with line notitle lc rgb \"green\""
CMDS="$CMDS, datafile$N using (\$1/30/60):(33) with line notitle lc rgb \"black\""
CMDS="$CMDS, datafile$N using (\$1/30/60):(66) with line notitle lc rgb \"red\""

#CMDS="set title \"B.A.S.P. (${TESTRUNS} testruns)\"
CMDS="set title \"3v3 CAIs (${N} testruns)\"
${CMDS}"


(
cat << EOF
$DATAFILES
$CMDS
EOF
) > /tmp/cplot

gnuplot /tmp/cplot

eog benchmark_total.png