-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
207 changed files
with
11,287 additions
and
12,359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ vendor/ | |
build/ | ||
.idea/ | ||
composer.lock | ||
perf/blackfire.io.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Framework agnostic JSON API implementation | ||
|
||
Copyright 2015 info@neomerx.com | ||
Copyright 2015-2019 info@neomerx.com | ||
|
||
This product includes software developed at Neomerx (www.neomerx.com). | ||
This product includes software developed at Neomerx (www.neomerx.com). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM php:7.3-cli | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ | ||
&& mkdir -p /tmp/blackfire \ | ||
&& curl -A "Docker" -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version | tar zxp -C /tmp/blackfire \ | ||
&& curl -A "Docker" -L -s https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire \ | ||
&& mv /tmp/blackfire/blackfire /usr/bin/blackfire \ | ||
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ | ||
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > /usr/local/etc/php/conf.d/blackfire.ini \ | ||
&& rm -Rf /tmp/blackfire \ | ||
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Credential should be taken from https://blackfire.io/my/settings/credentials | ||
# | ||
BLACKFIRE_CLIENT_ID=<put Client ID here> | ||
BLACKFIRE_CLIENT_TOKEN=<put Client Token here> | ||
BLACKFIRE_SERVER_ID=<put Server ID here> | ||
BLACKFIRE_SERVER_TOKEN=<put Server Token here> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3.7' | ||
|
||
services: | ||
cli_php: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
container_name: cli_php_json_api_blackfire | ||
env_file: blackfire.io.env | ||
volumes: | ||
- type: bind | ||
source: ./../ | ||
target: /app | ||
working_dir: /app | ||
tty: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Overview | ||
|
||
This is performance test suite for the library that uses [Blackfire](https://blackfire.io) _Performance Management Solution_. | ||
|
||
## Prerequisites | ||
- Install [docker](https://docs.docker.com/install/#supported-platforms); | ||
- Install [docker-compose](https://docs.docker.com/compose/install/). | ||
|
||
## Installation | ||
|
||
- Copy `blackfire.io.env.sample` to `blackfire.io.env`; | ||
- Put your Client ID, Client Token, Server ID and Server Token to `blackfire.io.env` from [Blackfire.io credentials page](https://blackfire.io/my/settings/credentials) (registration needed). | ||
|
||
## Profile Performance | ||
|
||
```bash | ||
$ docker-compose run --rm cli_php blackfire run php -d zend.assertions=-1 /app/sample/sample.php -t=100 | ||
``` | ||
|
||
The output will contain basic performance info and a URL with detailed profiling info [such as this one](https://blackfire.io/profiles/207fb294-d851-48ad-a31c-db29478172e3/graph). | ||
|
||
> Note: The **first** run will download necessary docker images which takes some time. The subsequent runs will not require such downloads and be faster. | ||
The created container can be removed from the local machine with | ||
|
||
```bash | ||
$ docker rmi perf_cli_php | ||
``` |
Oops, something went wrong.