File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ benchmark ()
8
8
9
9
echo " ab -c 10 -t 3 $url "
10
10
ab -c 10 -t 3 " $url " > " $ab_log "
11
- curl --dump-header " $benchmark_data " " $url " > " $output "
11
+ curl -H ' X-Include-Benchmark-Output-Data: 1 ' - -dump-header " $benchmark_data " " $url " > " $output "
12
12
13
13
rps=` grep " Requests per second:" " $ab_log " | cut -f 7 -d " " `
14
14
memory=` grep " X-Benchmark-Output-Data:" " $benchmark_data " | cut -f 2 -d ' :' | cut -f 2 -d ' ' `
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ // Only calculate output data if specifically requested
4
+ $ headers = getallheaders ();
5
+ if (!isset ($ headers ["X-Include-Benchmark-Output-Data " ])) {
6
+ return ;
7
+ }
8
+
3
9
// Get benchmark output data
4
10
$ real_usage = null ;
5
11
if (defined ('HHVM_VERSION ' )) {
You can’t perform that action at this time.
0 commit comments