From 2c6f499d95bfeb51ef03426a5a940765eb53232e Mon Sep 17 00:00:00 2001 From: Lori Krell Date: Tue, 31 Jul 2018 13:54:14 -0500 Subject: [PATCH 1/4] Create file and add content for new profiler CLI commands --- .../config-guide/bootstrap/mage-profiler.md | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/guides/v2.1/config-guide/bootstrap/mage-profiler.md b/guides/v2.1/config-guide/bootstrap/mage-profiler.md index bd6d37d61ce..8993167623c 100644 --- a/guides/v2.1/config-guide/bootstrap/mage-profiler.md +++ b/guides/v2.1/config-guide/bootstrap/mage-profiler.md @@ -5,9 +5,8 @@ title: Enable profiling (MAGE_PROFILER) menu_title: Enable profiling (MAGE_PROFILER) menu_order: 7 menu_node: -version: 2.1 +version: 2.2 github_link: config-guide/bootstrap/mage-profiler.md -redirect_from: /guides/v1.0/config-guide/bootstrap/mage-profiler.html functional_areas: - Configuration - System @@ -26,7 +25,12 @@ Magento profiling enables you to: Magento provides the base functionality in [Magento\\Framework\\Profiler]({{ site.mage2000url }}lib/internal/Magento/Framework/Profiler.php){:target="_blank"}. -## Set MAGE_PROFILER +You can enable and configure the profiler using a [MAGE_PROFILER](#variable) variable or the [command line](#cli). + +## Set MAGE_PROFILER {#variable} + +You can set the value of `MAGE_PROFILER` in any of the ways discussed in [Set the value of bootstrap parameters]({{ page.baseurl }}/config-guide/bootstrap/magento-how-to-set.html). + `MAGE_PROFILER` supports the following values: - `1` to enable a specific profiler's output. @@ -42,4 +46,28 @@ Magento provides the base functionality in [Magento\\Framework\\Profiler]({{ sit ![]({{ site.baseurl }}/common/images/config_depend-graphs.png) -You can set the value of `MAGE_PROFILER` in any of the ways discussed in [Set the value of bootstrap parameters]({{ page.baseurl }}/config-guide/bootstrap/magento-how-to-set.html). +## CLI commands {#cli} + +You can enable or disable the profiler using CLI commands: + +- `dev:profiler:enable ` enables the profiler with `type` of `html` (default) or `csvfile`. When enabled, a flagfile `var/profiler.flag` is created. +- `dev:profiler:disable` disables the profiler. When disabled, the flagfile `var/profiler.flag` is removed. + +To enable or diable the profiler: + +1. Use a terminal application to access your Magento instance. +1. Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. +1. Navigate to the root directory of your Magento 2 installation. +1. Enter `php bin/magento` with one of the commands to configure the profiler: + + To enable the profiler and create a flagfile: + + ```bash + php bin/magento dev:profiler:enable + ``` + + To disable the profiler and remove the flagfile: + + ```bash + php bin/magento dev:profiler:disable + ``` From 61e61567a23aab90a41afd19fc1dbd56e28315d4 Mon Sep 17 00:00:00 2001 From: Lori Krell Date: Tue, 7 Aug 2018 11:16:06 -0500 Subject: [PATCH 2/4] resetting branch after soft reset attempting line dif error --- .../config-guide/bootstrap/mage-profiler.md | 33 +-------- .../config-guide/bootstrap/mage-profiler.md | 74 ++++++++++++++++++- 2 files changed, 76 insertions(+), 31 deletions(-) mode change 120000 => 100644 guides/v2.2/config-guide/bootstrap/mage-profiler.md diff --git a/guides/v2.1/config-guide/bootstrap/mage-profiler.md b/guides/v2.1/config-guide/bootstrap/mage-profiler.md index 8993167623c..76514cffa67 100644 --- a/guides/v2.1/config-guide/bootstrap/mage-profiler.md +++ b/guides/v2.1/config-guide/bootstrap/mage-profiler.md @@ -5,8 +5,9 @@ title: Enable profiling (MAGE_PROFILER) menu_title: Enable profiling (MAGE_PROFILER) menu_order: 7 menu_node: -version: 2.2 +version: 2.1 github_link: config-guide/bootstrap/mage-profiler.md +redirect_from: /guides/v1.0/config-guide/bootstrap/mage-profiler.html functional_areas: - Configuration - System @@ -25,12 +26,8 @@ Magento profiling enables you to: Magento provides the base functionality in [Magento\\Framework\\Profiler]({{ site.mage2000url }}lib/internal/Magento/Framework/Profiler.php){:target="_blank"}. -You can enable and configure the profiler using a [MAGE_PROFILER](#variable) variable or the [command line](#cli). - ## Set MAGE_PROFILER {#variable} -You can set the value of `MAGE_PROFILER` in any of the ways discussed in [Set the value of bootstrap parameters]({{ page.baseurl }}/config-guide/bootstrap/magento-how-to-set.html). - `MAGE_PROFILER` supports the following values: - `1` to enable a specific profiler's output. @@ -46,28 +43,4 @@ You can set the value of `MAGE_PROFILER` in any of the ways discussed in [Set th ![]({{ site.baseurl }}/common/images/config_depend-graphs.png) -## CLI commands {#cli} - -You can enable or disable the profiler using CLI commands: - -- `dev:profiler:enable ` enables the profiler with `type` of `html` (default) or `csvfile`. When enabled, a flagfile `var/profiler.flag` is created. -- `dev:profiler:disable` disables the profiler. When disabled, the flagfile `var/profiler.flag` is removed. - -To enable or diable the profiler: - -1. Use a terminal application to access your Magento instance. -1. Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. -1. Navigate to the root directory of your Magento 2 installation. -1. Enter `php bin/magento` with one of the commands to configure the profiler: - - To enable the profiler and create a flagfile: - - ```bash - php bin/magento dev:profiler:enable - ``` - - To disable the profiler and remove the flagfile: - - ```bash - php bin/magento dev:profiler:disable - ``` +You can set the value of `MAGE_PROFILER` in any of the ways discussed in [Set the value of bootstrap parameters]({{ page.baseurl }}/config-guide/bootstrap/magento-how-to-set.html). diff --git a/guides/v2.2/config-guide/bootstrap/mage-profiler.md b/guides/v2.2/config-guide/bootstrap/mage-profiler.md deleted file mode 120000 index 5acb799d911..00000000000 --- a/guides/v2.2/config-guide/bootstrap/mage-profiler.md +++ /dev/null @@ -1 +0,0 @@ -../../../v2.1/config-guide/bootstrap/mage-profiler.md \ No newline at end of file diff --git a/guides/v2.2/config-guide/bootstrap/mage-profiler.md b/guides/v2.2/config-guide/bootstrap/mage-profiler.md new file mode 100644 index 00000000000..8993167623c --- /dev/null +++ b/guides/v2.2/config-guide/bootstrap/mage-profiler.md @@ -0,0 +1,73 @@ +--- +group: config-guide +subgroup: 03_Bootstrap +title: Enable profiling (MAGE_PROFILER) +menu_title: Enable profiling (MAGE_PROFILER) +menu_order: 7 +menu_node: +version: 2.2 +github_link: config-guide/bootstrap/mage-profiler.md +functional_areas: + - Configuration + - System + - Setup +--- + +Magento profiling enables you to: + +- Enable a built-in profiler. + + You can use a built-in profiler with Magento to perform tasks such as analyzing performance. (The nature of profiling depends on the analytical tools you use. We support multiple formats, including HTML.) + +- Displays dependency graphs on a Magento page. A *dependency graph* is a list of object dependencies and all of their all their dependencies, and all the dependencies for those dependencies, and so on. + + You should be particularly interested in the list of *unused dependencies*, which are objects that were created because they were requested in some constructor, but were never used (that is, none of their methods were called). As a result, processor time and memory spent to create these dependencies are wasted. + +Magento provides the base functionality in [Magento\\Framework\\Profiler]({{ site.mage2000url }}lib/internal/Magento/Framework/Profiler.php){:target="_blank"}. + +You can enable and configure the profiler using a [MAGE_PROFILER](#variable) variable or the [command line](#cli). + +## Set MAGE_PROFILER {#variable} + +You can set the value of `MAGE_PROFILER` in any of the ways discussed in [Set the value of bootstrap parameters]({{ page.baseurl }}/config-guide/bootstrap/magento-how-to-set.html). + +`MAGE_PROFILER` supports the following values: + +- `1` to enable a specific profiler's output. + + You can also use one of the following values to enable a specific profiler: + + - `csvfile` which uses [Magento\\Framework\\Profiler\\Driver\\Standard\\Output\\Csvfile]({{ site.mage2000url }}lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Csvfile.php){:target="_blank"} + - Any other value (except `2`), including an empty value, which uses [Magento\\Framework\\Profiler\\Driver\\Standard\\Output\\Html]({{ site.mage2000url }}lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Html.php){:target="_blank"} + +- `2` to enable dependency graphs. + + Dependency graphs typically display at the bottom of a page. The following figure shows portion of the output: + + ![]({{ site.baseurl }}/common/images/config_depend-graphs.png) + +## CLI commands {#cli} + +You can enable or disable the profiler using CLI commands: + +- `dev:profiler:enable ` enables the profiler with `type` of `html` (default) or `csvfile`. When enabled, a flagfile `var/profiler.flag` is created. +- `dev:profiler:disable` disables the profiler. When disabled, the flagfile `var/profiler.flag` is removed. + +To enable or diable the profiler: + +1. Use a terminal application to access your Magento instance. +1. Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. +1. Navigate to the root directory of your Magento 2 installation. +1. Enter `php bin/magento` with one of the commands to configure the profiler: + + To enable the profiler and create a flagfile: + + ```bash + php bin/magento dev:profiler:enable + ``` + + To disable the profiler and remove the flagfile: + + ```bash + php bin/magento dev:profiler:disable + ``` From 8eef1fc6b0fb7f36914e1f38aa63118002e83861 Mon Sep 17 00:00:00 2001 From: Lori Krell Date: Wed, 8 Aug 2018 10:06:33 -0500 Subject: [PATCH 3/4] Updates per devdocs review --- .../config-guide/bootstrap/mage-profiler.md | 4 +-- .../config-guide/bootstrap/mage-profiler.md | 25 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/guides/v2.1/config-guide/bootstrap/mage-profiler.md b/guides/v2.1/config-guide/bootstrap/mage-profiler.md index 76514cffa67..181356fe5d0 100644 --- a/guides/v2.1/config-guide/bootstrap/mage-profiler.md +++ b/guides/v2.1/config-guide/bootstrap/mage-profiler.md @@ -18,9 +18,9 @@ Magento profiling enables you to: - Enable a built-in profiler. - You can use a built-in profiler with Magento to perform tasks such as analyzing performance. (The nature of profiling depends on the analytical tools you use. We support multiple formats, including HTML.) + You can use a built-in profiler with Magento to perform tasks such as analyzing performance. The nature of profiling depends on the analytical tools you use. We support multiple formats, including HTML. -- Displays dependency graphs on a Magento page. A *dependency graph* is a list of object dependencies and all of their all their dependencies, and all the dependencies for those dependencies, and so on. +- Display dependency graphs on a Magento page. A *dependency graph* is a list of object dependencies and all of their all their dependencies, and all the dependencies for those dependencies, and so on. You should be particularly interested in the list of *unused dependencies*, which are objects that were created because they were requested in some constructor, but were never used (that is, none of their methods were called). As a result, processor time and memory spent to create these dependencies are wasted. diff --git a/guides/v2.2/config-guide/bootstrap/mage-profiler.md b/guides/v2.2/config-guide/bootstrap/mage-profiler.md index 8993167623c..00c992d1b23 100644 --- a/guides/v2.2/config-guide/bootstrap/mage-profiler.md +++ b/guides/v2.2/config-guide/bootstrap/mage-profiler.md @@ -17,9 +17,9 @@ Magento profiling enables you to: - Enable a built-in profiler. - You can use a built-in profiler with Magento to perform tasks such as analyzing performance. (The nature of profiling depends on the analytical tools you use. We support multiple formats, including HTML.) + You can use a built-in profiler with Magento to perform tasks such as analyzing performance. The nature of profiling depends on the analytical tools you use. We support multiple formats, including HTML. When you enable the profiler, a `var/profiler.flag` file generates indicating the profiler is enabled and configurations. When disabled, this file is deleted. -- Displays dependency graphs on a Magento page. A *dependency graph* is a list of object dependencies and all of their all their dependencies, and all the dependencies for those dependencies, and so on. +- Display dependency graphs on a Magento page. A *dependency graph* is a list of object dependencies and all of their all their dependencies, and all the dependencies for those dependencies, and so on. You should be particularly interested in the list of *unused dependencies*, which are objects that were created because they were requested in some constructor, but were never used (that is, none of their methods were called). As a result, processor time and memory spent to create these dependencies are wasted. @@ -53,17 +53,24 @@ You can enable or disable the profiler using CLI commands: - `dev:profiler:enable ` enables the profiler with `type` of `html` (default) or `csvfile`. When enabled, a flagfile `var/profiler.flag` is created. - `dev:profiler:disable` disables the profiler. When disabled, the flagfile `var/profiler.flag` is removed. -To enable or diable the profiler: +To enable dependency graphs, use the variable option. -1. Use a terminal application to access your Magento instance. -1. Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. -1. Navigate to the root directory of your Magento 2 installation. -1. Enter `php bin/magento` with one of the commands to configure the profiler: +To enable or disable the profiler: - To enable the profiler and create a flagfile: +1. Log in to your Magento server. +1. Change to your Magento installation directory. +1. As the Magento file system owner, enter the following command to configure the profiler: + + To enable the profiler using type `html` and create a flagfile: + + ```bash + php bin/magento dev:profiler:enable html + ``` + + To enable the profiler using type `csvfile` and create a flagfile: ```bash - php bin/magento dev:profiler:enable + php bin/magento dev:profiler:enable csvfile ``` To disable the profiler and remove the flagfile: From 4237cc393e7b315071f4023b57aac4800719f5cd Mon Sep 17 00:00:00 2001 From: Lori Krell Date: Wed, 8 Aug 2018 10:08:19 -0500 Subject: [PATCH 4/4] Removing old frontmatter --- guides/v2.2/config-guide/bootstrap/mage-profiler.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/guides/v2.2/config-guide/bootstrap/mage-profiler.md b/guides/v2.2/config-guide/bootstrap/mage-profiler.md index 00c992d1b23..25ca36ce865 100644 --- a/guides/v2.2/config-guide/bootstrap/mage-profiler.md +++ b/guides/v2.2/config-guide/bootstrap/mage-profiler.md @@ -1,10 +1,6 @@ --- group: config-guide -subgroup: 03_Bootstrap title: Enable profiling (MAGE_PROFILER) -menu_title: Enable profiling (MAGE_PROFILER) -menu_order: 7 -menu_node: version: 2.2 github_link: config-guide/bootstrap/mage-profiler.md functional_areas: