Skip to content

Commit 1fa93dc

Browse files
committed
feat: php-spx documentation
1 parent bd366c7 commit 1fa93dc

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

configuration/phpspx.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# PHP SPX Profiling
2+
3+
PHP SPX is a simple, free and open source profiler. It covers both FPM and CLI requests, and provides a built-in UI to visualise the generated reports. Of which a [demo can be seen here](https://noisebynorthwest.github.io/php-spx/demo/report.html?key=spx-full-20191229_175636-06d2fe5ee423-3795-233665123).
4+
5+
For more information, please see the [PHP SPX Github Repository](https://github.com/NoiseByNorthwest/php-spx).
6+
7+
8+
## Configuration
9+
10+
11+
To enable PHP SPX in your project environment, add to your `.env` file:
12+
```
13+
WARDEN_PHP_SPX=1
14+
```
15+
16+
## Usage
17+
18+
### CLI
19+
20+
Running the `warden spx` command, will place you within a PHP-SPX instrumented terminal. Where any PHP commands you run will be profiled.
21+
22+
You should see a SPX report printed after the command finishes. And there will also be a corresponding report within the control panel.
23+
24+
![Example CLI Report generated with PHP SPX](screenshots/phpspx-cli-report.png)
25+
26+
27+
### Web
28+
29+
Once an environment is started with the `WARDEN_PHP_SPX=1` flag set, all web requests will be profiled. To override this, you can uncheck the `Automatic start` option within the control panel.
30+
31+
![Example Web Report generated with PHP SPX](screenshots/phpspx-web-report.png)
32+
33+
### Control Panel / Viewer
34+
35+
To view the reports generated by PHP SPX, append `?SPX_UI_URI=/` to the end of your environment url (e.g `https://app.magento2.test/?SPX_UI_URI=/`).
36+
37+
![Example PHP SPX Control Panel](screenshots/phpspx-control-panel.png)
Loading
Loading
1.95 MB
Loading

0 commit comments

Comments
 (0)