SlideShare a Scribd company logo
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

More Related Content

What's hot

Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
James Titcumb
 
Dependency Injection in PHP
Dependency Injection in PHPDependency Injection in PHP
Dependency Injection in PHP
Kacper Gunia
 
Symfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendSymfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friend
Kirill Chebunin
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
Lorna Mitchell
 
PhpSpec 2.0 ilustrated by examples
PhpSpec 2.0 ilustrated by examplesPhpSpec 2.0 ilustrated by examples
PhpSpec 2.0 ilustrated by examples
Marcello Duarte
 
Php functions
Php functionsPhp functions
Php functions
JIGAR MAKHIJA
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf Conference
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)
Nikita Popov
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
JIGAR MAKHIJA
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
Mark Baker
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
Lin Yo-An
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Arc & Codementor
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Kacper Gunia
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
Mark Baker
 
Twig tips and tricks
Twig tips and tricksTwig tips and tricks
Twig tips and tricks
Javier Eguiluz
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
Mark Baker
 
PHPSpec BDD for PHP
PHPSpec BDD for PHPPHPSpec BDD for PHP
PHPSpec BDD for PHP
Marcello Duarte
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
Fabien Potencier
 
Generated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 GeneratorsGenerated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 Generators
Mark Baker
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?
Nikita Popov
 

What's hot (20)

Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
Dependency Injection in PHP
Dependency Injection in PHPDependency Injection in PHP
Dependency Injection in PHP
 
Symfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendSymfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friend
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
PhpSpec 2.0 ilustrated by examples
PhpSpec 2.0 ilustrated by examplesPhpSpec 2.0 ilustrated by examples
PhpSpec 2.0 ilustrated by examples
 
Php functions
Php functionsPhp functions
Php functions
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
 
Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
 
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
 
Twig tips and tricks
Twig tips and tricksTwig tips and tricks
Twig tips and tricks
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
PHPSpec BDD for PHP
PHPSpec BDD for PHPPHPSpec BDD for PHP
PHPSpec BDD for PHP
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
Generated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 GeneratorsGenerated Power: PHP 5.5 Generators
Generated Power: PHP 5.5 Generators
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?
 

Similar to Let's play a game with blackfire player

Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
Ben Scofield
 
Postman On Steroids
Postman On SteroidsPostman On Steroids
Postman On Steroids
Sara Tornincasa
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
raccoony
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
patter
 
Node Boot Camp
Node Boot CampNode Boot Camp
Node Boot Camp
Troy Miles
 
Taking Jenkins Pipeline to the Extreme
Taking Jenkins Pipeline to the ExtremeTaking Jenkins Pipeline to the Extreme
Taking Jenkins Pipeline to the Extreme
yinonavraham
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Wesley Beary
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
Ben Scofield
 
Debugging & profiling node.js
Debugging & profiling node.jsDebugging & profiling node.js
Debugging & profiling node.js
tomasperezv
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
Wesley Beary
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
Kévin Margueritte
 
Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3
Clinton Dreisbach
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
Slawomir Jasek
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
SecuRing
 
Jakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix toolsJakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix tools
DevSecCon
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
LittleBIGRuby
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
Lindsay Holmwood
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
SV Ruby on Rails Meetup
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
InfluxData
 

Similar to Let's play a game with blackfire player (20)

Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
Postman On Steroids
Postman On SteroidsPostman On Steroids
Postman On Steroids
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
Node Boot Camp
Node Boot CampNode Boot Camp
Node Boot Camp
 
Taking Jenkins Pipeline to the Extreme
Taking Jenkins Pipeline to the ExtremeTaking Jenkins Pipeline to the Extreme
Taking Jenkins Pipeline to the Extreme
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
 
Debugging & profiling node.js
Debugging & profiling node.jsDebugging & profiling node.js
Debugging & profiling node.js
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 
Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
Jakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix toolsJakob Holderbaum - Managing Shared secrets using basic Unix tools
Jakob Holderbaum - Managing Shared secrets using basic Unix tools
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 

Recently uploaded

Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 

Recently uploaded (20)

Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 

Let's play a game with blackfire player

  • 1. Let’s play a game with Blackfire Player MARCIN CZARNECKI - TECH LEAD @
  • 2. •The story of 3 lines of code •First step with Blackfire Player •Dockerize it all •Summary
  • 3. The story of 3 lines of code "A long Nme ago in a Galaxy far, far away...."
  • 4.
  • 5.
  • 6. •Possibility to run performance tests on internal ENVs •Ability to include it in Continuous Integrations •Easy integration with new & legacy apps
  • 7. Blackfire player “Powerful Web Crawling, Web TesNng, and Web Scraper applicaNon.”
  • 8. $ curl -OLsS https://get.blackfire.io/blackfire-player.phar
  • 9. $ 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
  • 10. $ 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
  • 11. # 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
  • 12. # 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
  • 13. # 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
  • 14. # 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
  • 15. # 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
  • 16. $ php blackfire-player.phar run scenario.bkf -v
  • 17. $ 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
  • 18. $ 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
  • 19. # 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
  • 20. # 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
  • 21. $ 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
  • 22. $ 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
  • 23. But what about performance?
  • 25.
  • 26.
  • 27. # 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
  • 28. # 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
  • 29. # 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
  • 30. # 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
  • 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
  • 35.
  • 37.
  • 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. Testing apps in docker
  • 43.
  • 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
  • 51. 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
  • 52. 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
  • 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>
  • 58. • Easy to write first scenario • Ability to run same tests on multiple env • Automated performance tests with blackfire • HTTP only
  • 59. Thank you for your attention twitter.com/scyzoryck github.com/scyzoryck