1
1
# Magento 2 - Debug module
2
2
Module for debugging Magento 2 performance. It works without overwriting any core files and it can be installed with composer.
3
3
4
+ ![ toolbar] ( ./view/base/web/images/readme/homepage.png )
5
+
6
+
7
+ #### The module supports Hyva Theme!
8
+
9
+ <img alt =" hyva " height =" 135 " width =" 300 " src =" ./view/base/web/images/readme/hyva.png " />
10
+
11
+
12
+ #### Important - the module is not intended to work in a production environment!
4
13
## Installation
5
14
1 . Enable developer mode ` php bin/magento deploy:mode:set developer `
6
- 2 . Register git repository ` composer config repositories.dbg git https://github.com/daseraf/magento2-debug.git `
7
- 3 . Install module via composer ` composer require daseraf/magento2-debug [--update-no-dev] `
8
- 4 . Register module ` php bin/magento setup:upgrade `
9
- 5 . Enable profiler in configuration: ` Stores -> Configuration -> Advanced -> Debug `
10
- 6 . Clear cache ` php bin/magento c:c `
15
+ 2 . Install module via composer ` composer require daseraf/magento2-debug `
16
+ 3 . Register module ` php bin/magento setup:upgrade `
17
+ 4 . Enable profiler in configuration: ` Stores -> Configuration -> Advanced -> Debug `
18
+ 5 . Clear cache ` php bin/magento c:c `
19
+
20
+ # If you want to see Callmap
21
+ For this functionality you will need to install the xhprof extension for your PHP interpreter
22
+ I recommend using PECL for these purposes.
23
+ https://pecl.php.net/package/xhprof
11
24
12
25
## Enable Callmap collector
13
26
> pecl install xhprof
@@ -18,32 +31,50 @@ Just enable extension:
18
31
Xhprof flags are set from the Magento admin panel
19
32
> Advanced -> Debug -> Data collectors -> Xhprof Flags
20
33
21
- ## Configuration
22
- All settings have only default scope and config type pool is set to environment for better integration with ` php bin/magento app:config:dump `
34
+ # If you want to monitor queries to the database, run this command
35
+ > php bin/magento debug:db-profiler: enable
36
+
37
+ This will add a profiler flag to the database section of the env.php file
38
+
39
+ ## To disable use the following command:
40
+ > php bin/magento debug:db-profiler: disable
23
41
24
42
## Compatibility
25
43
* Magento 2.2 - 2.4
26
44
* PHP 7.0 - 8.1
27
45
28
46
## Profiler collectors
29
- - Ajax
30
- - Cache
47
+ - Ajax - Please note that you can profile any requests coming into the platform, such as adding to cart
48
+ ![ ajax] ( ./view/base/web/images/readme/ajax.png )
49
+ - Call map - Shows the time spent performing each function. [ XHprof extension required] ( https://www.php.net/manual/en/book.xhprof.php )
50
+ ![ callmap-main] ( ./view/base/web/images/readme/callmap-main.png )
51
+ ![ callmap-popup] ( ./view/base/web/images/readme/callmap-popup.png )
52
+ - Database - Database queries and variable values
53
+ ![ database] ( ./view/base/web/images/readme/database.png )
54
+ - Events - Displays all sent events as well as the observers tracking them
55
+ ![ events] ( ./view/base/web/images/readme/events.png )
56
+ - Layout - Displays a list of blocks and the time spent on rendering them
57
+ ![ layout-render] ( ./view/base/web/images/readme/layout-render.png )
58
+ - Layout Rendering analysis (Layout tab) - Detailed information on each block and caching status for them.
59
+ ![ layout-block-cache.png] ( ./view/base/web/images/readme/layout-block-cache.png )
60
+ #### Attention - if you see that blocks are not cached, this is not a debugger error! Please make sure your block has cache_lifetime.
61
+ - Models - Displays loaded entity modules and the number of reloads without accessing the cache
62
+ ![ models] ( ./view/base/web/images/readme/models.png )
63
+ - Plugins - Shows the plugins that were called during the process, as well as the time spent on their work. Attention - the execution time of around plugins includes the execution time of all functions that will be called in the body of the plugin. Is not an error
64
+ ![ plugins] ( ./view/base/web/images/readme/plugins.png )
65
+ - Translations - here you can see all messages for which translation is missing
66
+ ![ translation] ( ./view/base/web/images/readme/translation.png )
67
+ - Cache (Status and Calls) - This tab displays all successful cache calls (cacheKey is displayed in the table)
68
+ ![ cache] ( ./view/base/web/images/readme/cache.png )
69
+ - Performance - here you can find a graph that is based on the output of the standard profiler from magento
70
+ ![ performance] ( ./view/base/web/images/readme/performance.png )
71
+ - Request/Response
72
+ ![ request] ( ./view/base/web/images/readme/request.png )
31
73
- Config
32
- - Customer
33
- - Database
34
- - Events
35
- - Layout
74
+ ![ config] ( ./view/base/web/images/readme/config.png )
36
75
- Memory
37
- - Models
38
- - Plugins
39
- - Request/Response
40
- - Performance
41
- - Translations
42
- - Call map - [ XHprof extension required] ( https://www.php.net/manual/en/book.xhprof.php )
76
+ ![ memory] ( ./view/base/web/images/readme/memory.png )
43
77
44
- ## For logging plugin performance setup this patch:
45
- https://github.com/Daseraf/magento2-debug/blob/master/core_patches/module-framwork.diff
46
-
47
78
## Additional features
48
79
- [ Whoops error handler] ( http://filp.github.io/whoops/ )
49
80
0 commit comments