Skip to content

Commit 4f7a238

Browse files
committed
Add benchmark kit files
1 parent 1a6c389 commit 4f7a238

File tree

12 files changed

+79
-15
lines changed

12 files changed

+79
-15
lines changed

.phpbenchmarks/codeLink.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
declare -A codeLinks=(
4+
[controller]="https://github.com/phpbenchmarks/symfony-common/blob/4.1.1/Controller/HelloWorldController.php"
5+
[route]="https://github.com/phpbenchmarks/symfony-common/blob/4.1.1/Resources/config/routing.yml"
6+
)

.phpbenchmarks/configuration.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
readonly PHPBENCHMARKS_PHP_5_6_ENABLED=false
4+
readonly PHPBENCHMARKS_PHP_7_0_ENABLED=false
5+
readonly PHPBENCHMARKS_PHP_7_1_ENABLED=true
6+
readonly PHPBENCHMARKS_PHP_7_2_ENABLED=true
7+
readonly PHPBENCHMARKS_PHP_7_3_ENABLED=true
8+
9+
readonly PHPBENCHMARKS_NAME="Symfony"
10+
readonly PHPBENCHMARKS_SLUG="symfony"
11+
12+
readonly PHPBENCHMARKS_BENCHMARK_URL="/benchmark/helloworld"
13+
14+
readonly PHPBENCHMARKS_DEPENDENCY_NAME="symfony/framework-bundle"
15+
16+
readonly PHPBENCHMARKS_DEPENDENCY_MAJOR_VERSION=4
17+
readonly PHPBENCHMARKS_DEPENDENCY_MINOR_VERSION=0
18+
readonly PHPBENCHMARKS_DEPENDENCY_BUGFIX_VERSION=15

.phpbenchmarks/initBenchmark.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
function clearCacheAndLogs() {
4+
rm -rf var/cache/*
5+
[ "$?" != "0" ] && exit 1
6+
chmod -R 777 var/cache
7+
[ "$?" != "0" ] && exit 1
8+
9+
rm -rf var/log/*
10+
[ "$?" != "0" ] && exit 1
11+
chmod -R 777 var/log
12+
[ "$?" != "0" ] && exit 1
13+
}
14+
15+
function initBenchmark() {
16+
clearCacheAndLogs
17+
18+
composer install --no-dev --classmap-authoritative
19+
[ "$?" != "0" ] && exit 1
20+
21+
clearCacheAndLogs
22+
php bin/console cache:warmup
23+
[ "$?" != "0" ] && exit 1
24+
25+
return 0
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello World !

.phpbenchmarks/vhost.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
server_name ____HOST____;
4+
root ____PROJECT_DIR____/public;
5+
location / {
6+
try_files $uri /index.php$is_args$args;
7+
}
8+
location ~ ^/(index).php(/|$) {
9+
fastcgi_pass unix:/run/php/____PHP_FPM_SOCK____;
10+
fastcgi_split_path_info ^(.+.php)(/.*)$;
11+
include fastcgi_params;
12+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
13+
fastcgi_param HTTPS off;
14+
fastcgi_param APP_ENV prod;
15+
fastcgi_param APP_DEBUG false;
16+
}
17+
error_log /var/log/nginx/benchmark_error.log;
18+
access_log /var/log/nginx/benchmark_access.log;
19+
}

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"type": "project",
55
"require": {
66
"php": "^7.1.3",
7-
"symfony/console": "4.0.*",
7+
"symfony/console": "4.0.15",
88
"symfony/flex": "^1.0",
9-
"symfony/framework-bundle": "4.0.*",
10-
"symfony/yaml": "4.0.*",
9+
"symfony/framework-bundle": "4.0.15",
10+
"symfony/yaml": "4.0.15",
1111
"phpbenchmarks/symfony-common": "4.1.1"
1212
},
1313
"config": {

composer.lock.php7.1

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.lock.php7.2

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.lock.php7.3

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

symfony.lock

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@
5656
"ref": "9f94d3ea453cd8a3b95db7f82592d7344fe3a76a"
5757
}
5858
},
59-
"symfony/contracts": {
60-
"version": "v1.0.2"
61-
},
6259
"symfony/debug": {
6360
"version": "v4.0.0"
6461
},
@@ -143,9 +140,6 @@
143140
"ref": "124be9a2b7cc035fd8c56f4fd2e19c907c1f3fb8"
144141
}
145142
},
146-
"symfony/var-exporter": {
147-
"version": "v4.2.1"
148-
},
149143
"symfony/yaml": {
150144
"version": "v4.0.0"
151145
},

var/cache/.gitkeep

100644100755
File mode changed.

var/log/.gitkeep

100644100755
File mode changed.

0 commit comments

Comments
 (0)