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

Tideways with Xhgui #18

Merged
merged 88 commits into from
Apr 1, 2019
Merged

Tideways with Xhgui #18

merged 88 commits into from
Apr 1, 2019

Conversation

Mte90
Copy link
Member

@Mte90 Mte90 commented Jul 5, 2018

I started working on that and is not yet ready.
Right now I am only doing the bash script and I will test later.

edit: testing instructions, modify vvv-custom.yml as so:

utilities:
  core: # The core VVV utility
    - memcached-admin # Object cache management
    - opcache-status # opcache management
    - phpmyadmin # Web based database client
    - webgrind # PHP Debugging
    - trusted-hosts # GitHub etc
    - tls-ca # SSL/TLS certificates
  mte90:
    - tideways

utility-sources:
    mte90:
      repo: https://github.com/mte90/vvv-utilities.git
      branch: xhgui-tideways

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

Trying with vagrant provision --provision-with="utility-core-tideways"

This tickets will fix Varying-Vagrant-Vagrants/VVV#1540

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

I am using:


utilities:
  core:
    - phpmyadmin
    - mailhog
    - php56
    - php71
    - php72
    - trusted-hosts
    - tls-ca
    - tideways
utility-sources:
    core: https://github.com/mte90/vvv-utilities.git
    branch: xhgui-tideways

But seems that with that command is not executing my script @tomjn

@tomjn
Copy link
Member

tomjn commented Jul 5, 2018

keep in mind that command will only execute the provisioner, it won't pull down updates or anything else, it just runs provision.sh for that utility if it exists

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

I downloaded inside /tmp/ my fork and switched the branch and executing directly to find issues.
I executed also the provision and not yet working in the official way.

@tomjn
Copy link
Member

tomjn commented Jul 5, 2018

I'm not sure what you mean by that, VVV utilities live in the provision/resources/ folder, VVV won't look in the /tmp folder

If you want to update the utility, you need to do that manually beforehand with:

vagrant provision --provision-with="utility-source-core"

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

I executed that but didn't worked with my fork.

For tmp I am testing the script on that folder in the meantime I don't find a fix for use the vagrant provision command.

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

Right now there are 3 problems:

  • few files on 7.0/7.1 are not copied
  • module tideways is not loaded
  • http://vvv.test:1337/ say 502 bad gateway

I am working on fix that issues, the rest seems working.

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

The actual remaining stuff is the 502 error on nginx.

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

Xhgui is active on http://192.168.50.4/xhgui/webroot/ but with issues on connecting to mongodb.

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

Now is connecting and intercepting all the request of xhgui itself but not seems from the rest of website also if is prepended.

Also url like http://vvv.test/xhgui/webroot/run/delete_all are not working probably because there is no rule on nginx about how to handle them but I need help to udnerstand how to configure nginx for VVV.

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

immagine
If @tomjn can help me to fix the rewrite issue of xhgui I will try to understand why is not profiling wordpress.
In any case my pr works with url that contain enable-tideways like domain.test?enable-tideways and use php =>7.0 as version in custom.yml file.

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

Seems that I got my issue for why is not loaded.
Actually tideways is compiled for php 7.2 and loaded only in that version but for the test site I was using one on php 7.1.
I am trying to udnerstand if I can compile for different version and add the support to mongodb to different php version too.

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

Ok now tideways is compiled against every php version and mongodb is symlinked :-)

@Mte90
Copy link
Member Author

Mte90 commented Jul 5, 2018

Yeah, is quite finished remain the issue of the url that is not rewritten and is ready to be merged :-D
Now detect the wordpress website very easily :-)

@Mte90
Copy link
Member Author

Mte90 commented Jul 6, 2018

I fixed that problem adding:

 location /xhgui/ {
        try_files $uri $uri/ /xhgui/webroot/index.php?$args;
        include        /etc/nginx/fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME         $document_root$fastcgi_script_name;
        fastcgi_pass   php;
        fastcgi_index  index.php;
    }

to /etc/nginx/default.conf but I am not sure if it is the right way.

tomjn
tomjn previously requested changes Jul 6, 2018
tideways/provision.sh Outdated Show resolved Hide resolved
tideways/provision.sh Outdated Show resolved Hide resolved
tideways/vvv-header.php Outdated Show resolved Hide resolved
tideways/provision.sh Outdated Show resolved Hide resolved
@tomjn
Copy link
Member

tomjn commented Jul 6, 2018

For Nginx, you can insert the nginx config as a new file directly inside the VM, it might get destroyed if the VM is recreated but that's what the provision.sh is there for :)

@Mte90
Copy link
Member Author

Mte90 commented Jul 6, 2018

I had problems on adding a new nginx file because I was trying to add a port to access to xhgui without success.
Now with adding stuff to that nginx file seems that everything works without problems.
I am not sure about what is the best way to add tools in VVV.

@tomjn
Copy link
Member

tomjn commented Jul 6, 2018

You'd do it the same way you would do any other nginx config file, drop it in the appropriate folder. There's no need to modify existing nginx files, the same way site provisioners don't modify existing files they just get their vvv-nginx.conf copied and renamed

@tomjn
Copy link
Member

tomjn commented Jul 6, 2018

Here is where VVV symlinks the nginx configs into the nginx config folder:

https://github.com/Varying-Vagrant-Vagrants/VVV/blob/develop/provision/provision-site.sh#L77

@Mte90
Copy link
Member Author

Mte90 commented Jul 6, 2018

My issues are with add a tool that is in a subfolder.
So the idea is to create a nginx config that show the folder on a specific port for vvv.test but I had problems to implement that.
The ohter step is add a new domain to VVV but I don't think that is the best option.
I need nginx rules for rewrite the URLs so I am not sure what approach use for domain/port to access to xhgui.

@Mte90
Copy link
Member Author

Mte90 commented Jul 7, 2018

Seems also that Mongodb is not starting automatically on vagrant up

@Mte90
Copy link
Member Author

Mte90 commented Mar 19, 2019

I had to revert back to tideways xhprof because:

  • xhgui doesn't work with that
  • the tideways of the repository is for the premium web service

xhprof is for the open source version, in the meantime I fixed few issues with mongodb and now xhgui is executed but I want to test it better.

@Mte90
Copy link
Member Author

Mte90 commented Mar 19, 2019

immagine
yes finally is working again!
the only problem that I see that is I have to run manually the mongodb provision because the internal path are not the right onewhen is executed from another script and I cannot find a fix.
In the meantime I will work on speed up the tideways compiling :-)

@tomjn
Copy link
Member

tomjn commented Mar 19, 2019

the only problem that I see that is I have to run manually the mongodb provision because the internal path are not the right onewhen is executed from another script and I cannot find a fix.

Can you ellaborate? Is this related to the value of the DIR variable?

@Mte90
Copy link
Member Author

Mte90 commented Mar 19, 2019

I think to the DIR variable because I am getting errors about a file that is not found (of the mongo provision).
Right now to be sure to execute the provisions I am doing these commands from the VM:

  • sudo /vagrant/provision/resources/mte90/mongodb/provision.sh
  • sudo /vagrant/provision/resources/mte90/tideways/provision.sh

@tomjn
Copy link
Member

tomjn commented Mar 19, 2019

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" may suffice, but I'm unsure why the script is the way it is at the moment so I'm wary of just replacing them

@Mte90
Copy link
Member Author

Mte90 commented Mar 19, 2019

I did a vide oto show it on working so also for the releasen otes we have something :-) https://www.youtube.com/watch?v=f2mHyhIOSso&feature=youtu.be

Evaluating if share also on reddit right now

@Mte90
Copy link
Member Author

Mte90 commented Mar 20, 2019

I added:

  • In case of wp-cli tideways is not executed
  • now the php files of xhgui will looks for 2 files inside the config folder custom-config.phpand custom-header.php so it is possible to customize it based on the needs

I still need to optimize the compile part of tideways.

Probably I will do another video when we will merge it to show it how to use it.

@Mte90
Copy link
Member Author

Mte90 commented Mar 23, 2019

Now when tideways is executed install also mongo without problems :-)

@Mte90 Mte90 self-assigned this Mar 23, 2019
@Mte90
Copy link
Member Author

Mte90 commented Mar 24, 2019

I will add support for qurey monitor to get disabled on profiling with https://github.com/johnbillion/query-monitor/blob/develop/query-monitor.php#L49

GitHub
The Developer Tools Panel for WordPress. Contribute to johnbillion/query-monitor development by creating an account on GitHub.

@Mte90
Copy link
Member Author

Mte90 commented Mar 26, 2019

I did also a patch for xhgui so we can have a more clean code and waiting from them for a merge so I can update this pr perftools/xhgui-collector#24

@Mte90
Copy link
Member Author

Mte90 commented Mar 26, 2019

also we have this guide about xhgui if we want to add in the docs:

Profiling PHP Part 2: Xhgui In-Depth
Profiling PHP Part 3: Practical Performance Tuning

@Mte90
Copy link
Member Author

Mte90 commented Mar 27, 2019

And also this one is done.
I think that we are ready for merge because right now include everything :-)

@tomjn
Copy link
Member

tomjn commented Apr 1, 2019

This is close enough now that I'm just going to merge it

@tomjn tomjn merged commit 87c5fa3 into Varying-Vagrant-Vagrants:master Apr 1, 2019
@Mte90 Mte90 deleted the xhgui-tideways branch April 24, 2019 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants