Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CLI command to enable and disable the Profiler #11407

Merged
merged 1 commit into from Nov 15, 2017

Conversation

peterjaap
Copy link
Contributor

@peterjaap peterjaap commented Oct 12, 2017

Added CLI command to enable and disable the Profiler

Description

Adjusted app/bootstrap.php to have it read out the flagfile var/profiler.flag to enable the profiler and added CLI commands to create and remove the file.

Fixed Issues (if relevant)

  1. Create new CLI command: enable/disable Magento Profiler #9277: Create new CLI command: enable/disable Magento Profiler

Manual testing scenarios

  1. php bin/magento dev:profiler:enable
  2. Open up a page
  3. Scroll down

Or;

  1. php bin/magento dev:profiler:enable csvfile
  2. Open up a page
  3. Open var/log/profiler.csv

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@peterjaap
Copy link
Contributor Author

peterjaap commented Oct 12, 2017

I thought about replacing the forward slashes in app/bootstrap.php to DIRECTORY_SEPARATOR but while I was doing that I noticed the forward slash is also hardcoded in this line; https://github.com/magento/magento2/blob/2.2-develop/app/bootstrap.php#L34

So I'm guessing Windows hosting isn't supported anymore.

@orlangur
Copy link
Contributor

@peterjaap,

So I'm guessing Windows hosting isn't supported anymore.

It was never supported, however, using forward slash does not cause any trouble under Windows :) Problems start when we need to compare some file path returned by a function, there a lot of str_replace(DIRECTORY_SEPARATOR, '/') junk over the code due to this.

@peterjaap
Copy link
Contributor Author

@orlangur so you advise against using the constant?

@orlangur
Copy link
Contributor

Nope, you can use forward slash and it will not cause any troubles even under Windows.

@peterjaap
Copy link
Contributor Author

@orlangur I've pushed my changes to my branch (https://github.com/peterjaap/magento2/commits/cli-command-profiler) but they're not showing up here?

@orlangur
Copy link
Contributor

@peterjaap I see them now, maybe there was a small lag.

@peterjaap
Copy link
Contributor Author

@orlangur ah yeah great. Now we just have to wait a gazillion hours for Travis to start&finish....

@peterjaap
Copy link
Contributor Author

@orlangur now Travis fails while saying "The job exceeded the maximum time limit for jobs, and has been terminated.". Help?

@orlangur
Copy link
Contributor

@peterjaap this was fixed in #11555. Please apply your changes as a single commit on top of 2.2-develop and force push to the same branch. Timeout should disappear then.

@peterjaap
Copy link
Contributor Author

@orlangur yes, thanks. All checks passed!

@peterjaap
Copy link
Contributor Author

peterjaap commented Nov 15, 2017

@orlangur @okorshenko what's the status on this?

@okorshenko okorshenko merged commit 4c26acf into magento:2.2-develop Nov 15, 2017
okorshenko pushed a commit that referenced this pull request Nov 15, 2017
@okorshenko
Copy link
Contributor

Hi @peterjaap sorry for the delay. We had some internal discussions about this PR.
It is merged. Thank you for your contribution!
The feature will be a part of 2.2.3

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Nov 15, 2017
@centminmod
Copy link

Not seeing this in 2.2.3 ?

php bin/magento dev:profiler:enable

                                                                  
  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  There are no commands defined in the "dev:profiler" namespace.  
                                                                  
  Did you mean one of these?                                      
      dev                                                         
      dev:tests                                                   
      dev:source-theme                                            
      dev:xml                                                     
      dev:urn-catalog                                             
      dev:di                                                      
      dev:query-log                                               
      dev:template-hints                                          
                                                                  

@orlangur
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line improvement Release Line: 2.2 up for grabs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants