@@ -4,15 +4,16 @@ benchmark ()
44 url=" $2 "
55 ab_log=" $output_dir /$fw .ab.log"
66 output=" $output_dir /$fw .output"
7+ benchmark_data=" $output_dir /$fw .benchmark_data"
78
89 echo " ab -c 10 -t 3 $url "
910 ab -c 10 -t 3 " $url " > " $ab_log "
10- curl " $url " > " $output "
11+ curl --dump-header " $benchmark_data " " $url " > " $output "
1112
1213 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 ' :' `
1617 echo " $fw : $rps : $memory : $time : $file " >> " $results_file "
1718
1819 echo " $fw " >> " $check_file "
@@ -35,9 +36,16 @@ benchmark ()
3536 tmp=` cat " $output " `
3637 error=" $error$tmp "
3738 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 " `
4149 error=" $error$tmp "
4250 fi
4351 if [ " $error " != " " ]; then
0 commit comments