Jelajahi Sumber

add php-spx profiler

Your Name 3 tahun lalu
induk
melakukan
7f1cf8a59b

+ 14 - 0
README.md

@@ -586,6 +586,7 @@ Next, open up the `bin/start` helper script and uncomment the line:
 
 Finally, restart the containers with `bin/restart`. After doing so, everything is now configured and you can use a browser extension to profile your Magento store with Blackfire.
 
+<<<<<<< HEAD
 ### Cloudflare Tunnel
 
 These docker images have built-in support for Cloudflare Tunnel. It can be useful for testing implementations that require some third-party integrations involving allow-listing domains. Since your local app cannot be allow-listed by other services, you can use Cloudflare Tunnel to get a public hostname that can be allow-listed on the other service.
@@ -692,6 +693,19 @@ body {
 
 Upon saving this file, we will see the Grunt watcher detect the changes, and your browser should automatically load the new style without you needing to refresh the page, and without a full browser refresh.
 
+### PHP-SPX
+
+The images also have additional profiler-tracers built-in to the <a href="https://github.com/NoiseByNorthwest/php-spx/tree/master#web-ui" target="_blank">Web UI.</a>
+
+To access the control panel, just open the following URL: `https://magento.test/?SPX_KEY=dev&SPX_UI_URI=/`
+
+Profiling is also possible via command line and curl:
+
+```
+SPX_ENABLED=1 SPX_REPORT=full bin/magento {command_name}
+curl --cookie "SPX_ENABLED=1; SPX_KEY=dev" https://magento.test/
+```
+
 ## Credits
 
 ### M.academy

+ 3 - 0
images/php/8.1/conf/php-fpm.conf

@@ -29,3 +29,6 @@ clear_env = no
 
 ; Ensure worker stdout and stderr are sent to the main error log.
 catch_workers_output = yes
+
+; This needed to make PHP-SPX work in fpm mode
+process.dumpable = yes

+ 8 - 1
images/php/8.1/conf/php.ini

@@ -1,6 +1,6 @@
 memory_limit = 4G
 max_execution_time = 1800
-zlib.output_compression = On
+zlib.output_compression = 0
 cgi.fix_pathinfo = 0
 date.timezone = UTC
 
@@ -13,3 +13,10 @@ post_max_size = 100M
 max_input_vars = 10000
 
 sendmail_path = "/usr/bin/msmtp -t"
+
+#SPX profiler
+extension = /usr/lib/php-spx/modules/spx.so
+spx.http_enabled = 1
+spx.http_key = "dev"
+spx.http_ip_whitelist = "*"
+spx.data_dir = /var/www/spx_dumps

+ 3 - 0
images/php/8.2/conf/php-fpm.conf

@@ -29,3 +29,6 @@ clear_env = no
 
 ; Ensure worker stdout and stderr are sent to the main error log.
 catch_workers_output = yes
+
+; This needed to make PHP-SPX work in fpm mode
+process.dumpable = yes

+ 8 - 1
images/php/8.2/conf/php.ini

@@ -1,6 +1,6 @@
 memory_limit = 4G
 max_execution_time = 1800
-zlib.output_compression = On
+zlib.output_compression = 0
 cgi.fix_pathinfo = 0
 date.timezone = UTC
 
@@ -13,3 +13,10 @@ post_max_size = 100M
 max_input_vars = 10000
 
 sendmail_path = "/usr/bin/msmtp -t"
+
+#SPX profiler
+extension = /usr/lib/php-spx/modules/spx.so
+spx.http_enabled = 1
+spx.http_key = "dev"
+spx.http_ip_whitelist = "*"
+spx.data_dir = /var/www/spx_dumps