@@ -4,15 +4,16 @@ benchmark ()
4
4
url=" $2 "
5
5
ab_log=" $output_dir /$fw .ab.log"
6
6
output=" $output_dir /$fw .output"
7
+ benchmark_data=" $output_dir /$fw .benchmark_data"
7
8
8
9
echo " ab -c 10 -t 3 $url "
9
10
ab -c 10 -t 3 " $url " > " $ab_log "
10
- curl " $url " > " $output "
11
+ curl --dump-header " $benchmark_data " " $url " > " $output "
11
12
12
13
rps=` grep " Requests per second:" " $ab_log " | cut -f 7 -d " " `
13
- memory=` tail -1 " $output " | cut -f 1 -d ' :' `
14
- time=` tail -1 " $output " | cut -f 2 -d ' :' `
15
- file=` tail -1 " $output " | cut -f 3 -d ' :' `
14
+ memory=` grep " X-Benchmark-Output-Data: " " $benchmark_data " | cut -f 2 -d ' :' | cut -f 2 -d ' ' `
15
+ time=` grep " X-Benchmark-Output-Data: " " $benchmark_data " | cut -f 3 -d ' :' `
16
+ file=` grep " X-Benchmark-Output-Data: " " $benchmark_data " | cut -f 4 -d ' :' `
16
17
echo " $fw : $rps : $memory : $time : $file " >> " $results_file "
17
18
18
19
echo " $fw " >> " $check_file "
@@ -35,9 +36,16 @@ benchmark ()
35
36
tmp=` cat " $output " `
36
37
error=" $error$tmp "
37
38
fi
38
- x=` grep ' :' " $output " || true`
39
- if [ " $x " = " " ]; then
40
- tmp=` cat " $output " `
39
+ if [ " $memory " = " " ]; then
40
+ tmp=` cat " $benchmark_data " `
41
+ error=" $error$tmp "
42
+ fi
43
+ if [ " $time " = " " ]; then
44
+ tmp=` cat " $benchmark_data " `
45
+ error=" $error$tmp "
46
+ fi
47
+ if [ " $file " = " " ]; then
48
+ tmp=` cat " $benchmark_data " `
41
49
error=" $error$tmp "
42
50
fi
43
51
if [ " $error " != " " ]; then
0 commit comments