Let’s play a game with Blackfire Player
MARCIN CZARNECKI - TECH LEAD @
•The story of 3 lines of code
•First step with Blackfire Player
•Dockerize it all
•Summary
The story of 3 lines of code
"A long Nme ago in a Galaxy far, far away...."
•Possibility to run performance tests on internal ENVs
•Ability to include it in Continuous Integrations
•Easy integration with new & legacy apps
Blackfire player
“Powerful Web Crawling, Web TesNng, and Web Scraper applicaNon.”
$ curl -OLsS https://get.blackfire.io/blackfire-player.phar
$ curl -OLsS https://get.blackfire.io/blackfire-player.phar
$ php blackfire-player.phar list
Blackfire Player v1.4.1
Usage:
command [options] [arguments]
Available commands:
help Displays help for a command
list Lists commands
run Runs scenario files
validate Validate scenario files
$ curl -OLsS https://get.blackfire.io/blackfire-player.phar
$ php blackfire-player.phar list
Blackfire Player v1.4.1
Usage:
command [options] [arguments]
Available commands:
help Displays help for a command
list Lists commands
run Runs scenario files
validate Validate scenario files
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 10
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 10
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 10
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 10
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 10
$ php blackfire-player.phar run scenario.bkf -v
$ php blackfire-player.phar run scenario.bkf -v
Blackfire Player
Scenario "Games API"
"It shows correct number of elements list"
GET https://api.gog.com/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL
Failure on step "It shows correct number of elements list" defined in blackfire/
scenario.bkf at line 5
└ Expectation "json('_embedded.items | length(@)') == 10" failed.
└ json("_embedded.items | length(@)") = 9
KO Scenarios 1 - Steps 1 - Failures 1
$ php blackfire-player.phar run scenario.bkf -v
Blackfire Player
Scenario "Games API"
"It shows correct number of elements list"
GET https://api.gog.com/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL
Failure on step "It shows correct number of elements list" defined in blackfire/
scenario.bkf at line 5
└ Expectation "json('_embedded.items | length(@)') == 10" failed.
└ json("_embedded.items | length(@)") = 9
KO Scenarios 1 - Steps 1 - Failures 1
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 10
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 9
$ php blackfire-player.phar run scenario.bkf -v
Blackfire Player
Scenario "Games API"
"It shows correct number of elements list"
GET https://api.gog.com/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL
OK
OK Scenarios 1 - Steps 1
$ php blackfire-player.phar run scenario.bkf 
—endpoint=https://some.internal.env
Blackfire Player
Scenario "Games API"
"It shows correct number of elements list"
GET https://some.internal.env/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL
OK
OK Scenarios 1 - Steps 1
But what about performance?
“Performance Management Solution”
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 9
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 9
assert metrics.http.requests.count == 0
assert metrics.doctrine.entities.hydrated.count < 10
assert metrics.sql.queries.count < 3
warmup 1
samples 5
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 9
assert metrics.http.requests.count == 0
assert metrics.doctrine.entities.hydrated.count < 10
assert metrics.sql.queries.count < 3
warmup 1
samples 5
# scenario.bkf
scenario
name "Games API"
endpoint 'https://api.gog.com'
visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL')
name "It shows correct number of elements list"
expect status_code() == 200
expect json('_embedded.items | length(@)') == 9
assert metrics.http.requests.count == 0
assert metrics.doctrine.entities.hydrated.count < 10
assert metrics.sql.queries.count < 3
warmup 1
samples 5
$ export BLACKFIRE_CLIENT_ID=<id>
$ export BLACKFIRE_CLIENT_TOKEN=<token>
$ php blackfire-player.phar run scenario.bkf --blackfire-env=<id>
$ export BLACKFIRE_CLIENT_ID=<id>
$ export BLACKFIRE_CLIENT_TOKEN=<token>
$ php blackfire-player.phar run scenario.bkf --blackfire-env=<id>
$ export BLACKFIRE_CLIENT_ID=<id>
$ export BLACKFIRE_CLIENT_TOKEN=<token>
$ php blackfire-player.phar run scenario.bkf —blackfire-env=<id>
Blackfire Player
Scenario "Games API"
Blackfire Report at https://blackfire.io/envs/<id>/builds/
13ca7881-1802-4748-9208-1fb3a30cbaa5
OK
OK Scenarios 1 - Steps 7
$ export BLACKFIRE_CLIENT_ID=<id>
$ export BLACKFIRE_CLIENT_TOKEN=<token>
$ php blackfire-player.phar run scenario.bkf --blackfire-env=<id>
Blackfire Player
Scenario "Games API"
Blackfire Report at https://blackfire.io/envs/<id>/builds/
13ca7881-1802-4748-9208-1fb3a30cbaa5
OK
OK Scenarios 1 - Steps 7
Dockerize it all!
$ export BLACKFIRE_CLIENT_ID=<id>
$ export BLACKFIRE_CLIENT_TOKEN=<token>
$ php blackfire-player.phar run scenario.bkf 
—blackfire-env=<id> —endpoint=http://www.gog.com
docker run 
-v `pwd`:/app 
-e BLACKFIRE_CLIENT_ID 
-e BLACKFIRE_CLIENT_TOKEN 
blackfire/player 
run scenario.bkf 
—blackfire-env=<id> 
—endpoint=http://www.gog.com
$ export BLACKFIRE_CLIENT_ID=<id>
$ export BLACKFIRE_CLIENT_TOKEN=<token>
$ php blackfire-player.phar run scenario.bkf 
—blackfire-env=<id> —endpoint=http://www.gog.com
docker run 
-v `pwd`:/app 
-e BLACKFIRE_CLIENT_ID 
-e BLACKFIRE_CLIENT_TOKEN 
blackfire/player 
run scenario.bkf 
—blackfire-env=<id> 
—endpoint=http://www.gog.com
$ export BLACKFIRE_CLIENT_ID=<id>
$ export BLACKFIRE_CLIENT_TOKEN=<token>
$ php blackfire-player.phar run scenario.bkf 
—blackfire-env=<id> —endpoint=http://www.gog.com
docker run 
-v `pwd`:/app 
-e BLACKFIRE_CLIENT_ID 
-e BLACKFIRE_CLIENT_TOKEN 
blackfire/player 
run scenario.bkf 
—blackfire-env=<id> 
—endpoint=http://www.gog.com
alias blackfire-player="docker run --rm -it -e BLACKFIRE_CLIENT_ID -e
BLACKFIRE_CLIENT_TOKEN -v "`pwd`:/app" blackfire/player"
blackfire-player run scenario.bkf 
—blackfire-env=<id> 
—endpoint=http://www.gog.com
Testing apps in docker
version: "3.3"
services:
php-upstream:
image: php:8.0
volumes: [ .:/app ]
nginx:
image: nginx:alpine
depends_on:
- php-upstream
volumes:
- ./web:/data/application/web:delegated
version: "3.3"
services:
php-upstream:
image: php:7.3
volumes: [ .:/app ]
nginx:
image: nginx:alpine
depends_on:
- php-upstream
volumes:
- ./web:/data/application/web:delegated
version: "3.3"
services:
php-upstream:
image: php:7.3
volumes: [ .:/app ]
nginx:
image: nginx:alpine
depends_on:
- php-upstream
volumes:
- ./web:/data/application/web:delegated
version: "3.3"
services:
php-upstream:
image: php:7.3
volumes: [ .:/app ]
nginx:
image: nginx:alpine
depends_on:
- php-upstream
volumes:
- ./web:/data/application/web:delegated
networks:
default:
name: my_app
docker run 
--rm 
-v `pwd`:/app 
--network=my_app 
scyzoryck/blackfire-player 
run scenario.bkf —endpoint=http://nginx
docker run 
--rm 
-v `pwd`:/app 
--network=my_app 
scyzoryck/blackfire-player 
run scenario.bkf —endpoint=http://nginx
FROM php:8.0
FROM php:8.0
ENV current_os=linux
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") 
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/
releases/probe/php/$current_os/amd64/$version 
&& mkdir -p /tmp/blackfire 
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire 
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so

&& printf "extension=blackfire.sonblackfire.agent_socket=tcp://blackfire:8707n" >
$PHP_INI_DIR/conf.d/blackfire.ini 
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
FROM php:8.0
ENV current_os=linux
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") 
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/
releases/probe/php/$current_os/amd64/$version 
&& mkdir -p /tmp/blackfire 
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire 
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so

&& printf "extension=blackfire.sonblackfire.agent_socket=tcp://blackfire:8707n" >
$PHP_INI_DIR/conf.d/blackfire.ini 
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
version: "3.3"
services:
php-upstream:
image: php-blackfire
volumes: [ .:/app ]
nginx:
image: registry-gitlab.gog.com/docker/nginx:alpine
depends_on:
- php-upstream
volumes:
- ./web:/data/application/web:delegated
networks:
default:
name: my_app
version: "3.3"
services:
php-upstream:
image: php-blackfire
volumes: [ .:/app ]
nginx:
image: registry-gitlab.gog.com/docker/nginx:alpine
depends_on:
- php-upstream
volumes:
- ./web:/data/application/web:delegated
blackfire:
image: blackfire/blackfire
environment: [BLACKFIRE_SERVER_ID,BLACKFIRE_SERVER_TOKEN]
networks:
default:
name: my_app
docker run 
--rm 
-v `pwd`:/app 
-e BLACKFIRE_CLIENT_ID 
-e BLACKFIRE_CLIENT_TOKEN 
--network=my_app 
scyzoryck/blackfire-player 
run scenario.bkf --endpoint=http://nginx
—blackfire-env=<id>
docker run 
--rm 
-v `pwd`:/app 
-e BLACKFIRE_CLIENT_ID 
-e BLACKFIRE_CLIENT_TOKEN 
--network=my_app 
scyzoryck/blackfire-player 
run scenario.bkf --endpoint=http://nginx
—blackfire-env=<id>
Summary
• Easy to write first scenario
• Ability to run same tests on multiple env
• Automated performance tests with blackfire
• HTTP only
Thank you for your attention
twitter.com/scyzoryck
github.com/scyzoryck

Let's play a game with blackfire player

  • 1.
    Let’s play agame with Blackfire Player MARCIN CZARNECKI - TECH LEAD @
  • 2.
    •The story of3 lines of code •First step with Blackfire Player •Dockerize it all •Summary
  • 3.
    The story of3 lines of code "A long Nme ago in a Galaxy far, far away...."
  • 6.
    •Possibility to runperformance tests on internal ENVs •Ability to include it in Continuous Integrations •Easy integration with new & legacy apps
  • 7.
    Blackfire player “Powerful WebCrawling, Web TesNng, and Web Scraper applicaNon.”
  • 8.
    $ curl -OLsShttps://get.blackfire.io/blackfire-player.phar
  • 9.
    $ curl -OLsShttps://get.blackfire.io/blackfire-player.phar $ php blackfire-player.phar list Blackfire Player v1.4.1 Usage: command [options] [arguments] Available commands: help Displays help for a command list Lists commands run Runs scenario files validate Validate scenario files
  • 10.
    $ curl -OLsShttps://get.blackfire.io/blackfire-player.phar $ php blackfire-player.phar list Blackfire Player v1.4.1 Usage: command [options] [arguments] Available commands: help Displays help for a command list Lists commands run Runs scenario files validate Validate scenario files
  • 11.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 10
  • 12.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 10
  • 13.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 10
  • 14.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 10
  • 15.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 10
  • 16.
    $ php blackfire-player.pharrun scenario.bkf -v
  • 17.
    $ php blackfire-player.pharrun scenario.bkf -v Blackfire Player Scenario "Games API" "It shows correct number of elements list" GET https://api.gog.com/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL Failure on step "It shows correct number of elements list" defined in blackfire/ scenario.bkf at line 5 └ Expectation "json('_embedded.items | length(@)') == 10" failed. └ json("_embedded.items | length(@)") = 9 KO Scenarios 1 - Steps 1 - Failures 1
  • 18.
    $ php blackfire-player.pharrun scenario.bkf -v Blackfire Player Scenario "Games API" "It shows correct number of elements list" GET https://api.gog.com/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL Failure on step "It shows correct number of elements list" defined in blackfire/ scenario.bkf at line 5 └ Expectation "json('_embedded.items | length(@)') == 10" failed. └ json("_embedded.items | length(@)") = 9 KO Scenarios 1 - Steps 1 - Failures 1
  • 19.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 10
  • 20.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 9
  • 21.
    $ php blackfire-player.pharrun scenario.bkf -v Blackfire Player Scenario "Games API" "It shows correct number of elements list" GET https://api.gog.com/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL OK OK Scenarios 1 - Steps 1
  • 22.
    $ php blackfire-player.pharrun scenario.bkf —endpoint=https://some.internal.env Blackfire Player Scenario "Games API" "It shows correct number of elements list" GET https://some.internal.env/products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL OK OK Scenarios 1 - Steps 1
  • 23.
    But what aboutperformance?
  • 24.
  • 27.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 9
  • 28.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 9 assert metrics.http.requests.count == 0 assert metrics.doctrine.entities.hydrated.count < 10 assert metrics.sql.queries.count < 3 warmup 1 samples 5
  • 29.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 9 assert metrics.http.requests.count == 0 assert metrics.doctrine.entities.hydrated.count < 10 assert metrics.sql.queries.count < 3 warmup 1 samples 5
  • 30.
    # scenario.bkf scenario name "GamesAPI" endpoint 'https://api.gog.com' visit url('products/prices?ids=1,2,3,4,5,6,7,8,9,10&countryCode=PL') name "It shows correct number of elements list" expect status_code() == 200 expect json('_embedded.items | length(@)') == 9 assert metrics.http.requests.count == 0 assert metrics.doctrine.entities.hydrated.count < 10 assert metrics.sql.queries.count < 3 warmup 1 samples 5
  • 31.
    $ export BLACKFIRE_CLIENT_ID=<id> $export BLACKFIRE_CLIENT_TOKEN=<token> $ php blackfire-player.phar run scenario.bkf --blackfire-env=<id>
  • 32.
    $ export BLACKFIRE_CLIENT_ID=<id> $export BLACKFIRE_CLIENT_TOKEN=<token> $ php blackfire-player.phar run scenario.bkf --blackfire-env=<id>
  • 33.
    $ export BLACKFIRE_CLIENT_ID=<id> $export BLACKFIRE_CLIENT_TOKEN=<token> $ php blackfire-player.phar run scenario.bkf —blackfire-env=<id> Blackfire Player Scenario "Games API" Blackfire Report at https://blackfire.io/envs/<id>/builds/ 13ca7881-1802-4748-9208-1fb3a30cbaa5 OK OK Scenarios 1 - Steps 7
  • 34.
    $ export BLACKFIRE_CLIENT_ID=<id> $export BLACKFIRE_CLIENT_TOKEN=<token> $ php blackfire-player.phar run scenario.bkf --blackfire-env=<id> Blackfire Player Scenario "Games API" Blackfire Report at https://blackfire.io/envs/<id>/builds/ 13ca7881-1802-4748-9208-1fb3a30cbaa5 OK OK Scenarios 1 - Steps 7
  • 36.
  • 38.
    $ export BLACKFIRE_CLIENT_ID=<id> $export BLACKFIRE_CLIENT_TOKEN=<token> $ php blackfire-player.phar run scenario.bkf —blackfire-env=<id> —endpoint=http://www.gog.com docker run -v `pwd`:/app -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN blackfire/player run scenario.bkf —blackfire-env=<id> —endpoint=http://www.gog.com
  • 39.
    $ export BLACKFIRE_CLIENT_ID=<id> $export BLACKFIRE_CLIENT_TOKEN=<token> $ php blackfire-player.phar run scenario.bkf —blackfire-env=<id> —endpoint=http://www.gog.com docker run -v `pwd`:/app -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN blackfire/player run scenario.bkf —blackfire-env=<id> —endpoint=http://www.gog.com
  • 40.
    $ export BLACKFIRE_CLIENT_ID=<id> $export BLACKFIRE_CLIENT_TOKEN=<token> $ php blackfire-player.phar run scenario.bkf —blackfire-env=<id> —endpoint=http://www.gog.com docker run -v `pwd`:/app -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN blackfire/player run scenario.bkf —blackfire-env=<id> —endpoint=http://www.gog.com
  • 41.
    alias blackfire-player="docker run--rm -it -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN -v "`pwd`:/app" blackfire/player" blackfire-player run scenario.bkf —blackfire-env=<id> —endpoint=http://www.gog.com
  • 42.
  • 44.
    version: "3.3" services: php-upstream: image: php:8.0 volumes:[ .:/app ] nginx: image: nginx:alpine depends_on: - php-upstream volumes: - ./web:/data/application/web:delegated
  • 45.
    version: "3.3" services: php-upstream: image: php:7.3 volumes:[ .:/app ] nginx: image: nginx:alpine depends_on: - php-upstream volumes: - ./web:/data/application/web:delegated
  • 46.
    version: "3.3" services: php-upstream: image: php:7.3 volumes:[ .:/app ] nginx: image: nginx:alpine depends_on: - php-upstream volumes: - ./web:/data/application/web:delegated
  • 47.
    version: "3.3" services: php-upstream: image: php:7.3 volumes:[ .:/app ] nginx: image: nginx:alpine depends_on: - php-upstream volumes: - ./web:/data/application/web:delegated networks: default: name: my_app
  • 48.
    docker run --rm -v `pwd`:/app --network=my_app scyzoryck/blackfire-player run scenario.bkf —endpoint=http://nginx
  • 49.
    docker run --rm -v `pwd`:/app --network=my_app scyzoryck/blackfire-player run scenario.bkf —endpoint=http://nginx
  • 50.
  • 51.
    FROM php:8.0 ENV current_os=linux RUNversion=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/ releases/probe/php/$current_os/amd64/$version && mkdir -p /tmp/blackfire && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so && printf "extension=blackfire.sonblackfire.agent_socket=tcp://blackfire:8707n" > $PHP_INI_DIR/conf.d/blackfire.ini && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
  • 52.
    FROM php:8.0 ENV current_os=linux RUNversion=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/ releases/probe/php/$current_os/amd64/$version && mkdir -p /tmp/blackfire && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so && printf "extension=blackfire.sonblackfire.agent_socket=tcp://blackfire:8707n" > $PHP_INI_DIR/conf.d/blackfire.ini && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
  • 53.
    version: "3.3" services: php-upstream: image: php-blackfire volumes:[ .:/app ] nginx: image: registry-gitlab.gog.com/docker/nginx:alpine depends_on: - php-upstream volumes: - ./web:/data/application/web:delegated networks: default: name: my_app
  • 54.
    version: "3.3" services: php-upstream: image: php-blackfire volumes:[ .:/app ] nginx: image: registry-gitlab.gog.com/docker/nginx:alpine depends_on: - php-upstream volumes: - ./web:/data/application/web:delegated blackfire: image: blackfire/blackfire environment: [BLACKFIRE_SERVER_ID,BLACKFIRE_SERVER_TOKEN] networks: default: name: my_app
  • 55.
    docker run --rm -v `pwd`:/app -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN --network=my_app scyzoryck/blackfire-player run scenario.bkf --endpoint=http://nginx —blackfire-env=<id>
  • 56.
    docker run --rm -v `pwd`:/app -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN --network=my_app scyzoryck/blackfire-player run scenario.bkf --endpoint=http://nginx —blackfire-env=<id>
  • 57.
  • 58.
    • Easy towrite first scenario • Ability to run same tests on multiple env • Automated performance tests with blackfire • HTTP only
  • 59.
    Thank you foryour attention twitter.com/scyzoryck github.com/scyzoryck