Git Product home page Git Product logo

chassis_xhgui's Introduction

XHGui

A Chassis extension to install and configure XHGui on your Chassis server. This extension also has XHProf as a dependency so it will be installed and configured automatically as well.

Installation

  1. Add this extension to your extensions directory git clone --recursive [email protected]:Chassis/Chassis_XHGui.git extensions/chassis_xhgui
  2. Note: The folder that you clone into must be called chassis_xhgui.
  3. Run vagrant provision.

Alternative Installation

  1. Add - chassis/chassis_xhgui to your extensions in yaml files. e.g.
    extensions:
    - chassis/chassis_xhgui
    
  2. Run vagrant provision.

Please note: vagrant provision can take quite a few minutes due to the amount of Composer dependencies in XHGui. So when you see the provisioning process taking a long time on Service[php7.0-fpm] please be patient as this is the stage where Composer dependencies are being installed.

Usage

Browse to http://vagrant.local/xhgui in a browser. If you have a custom host hame it will be http://<yourhostname>.local/xhgui.

If you're using custom paths you'll need to change the URL to add your custom base. For example: If you've Chassis located in a chassis folder then the URL will be http://vagrant.local/chassis/xhgui or http://<yourhostname>.local/chassis/xhgui.

Controlling When the Profiler Runs

This extension enables the XHProf profiler for every request. You can control whether or not the profiler runs from the profiler.enable callback function that is contained within the extensions/chassis_xhgui/xhgui/config/config.php file.

From this callback function you can perform logic based on $_SERVER values, php_sapi_name(), etc, but remember that WordPress has not loaded at this point so you can't use any function that WordPress provides.

'profiler.enable' => function() {
	if ( false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin/' ) ) {
		// Disable the profiler for requests to wp-admin:
		return false;
	}

	// Enable the profiler for all other requests:
	return true;
},

Further information about configuring the profiler and other XHGUI options can be found in the XHGUI repo documentation.

Uninstallation

  1. Add - chassis/chassis_xhgui to your disabled_extensions in yaml files. e.g.
    disabled_extensions:
    - chassis/chassis_xhgui
    
  2. Run vagrant provision.

Screenshots

Recent Runs

Profile Data

Call Graph

Flame Graph

Function Calls

chassis_xhgui's People

Contributors

bronsonquick avatar johnbillion avatar ntwb avatar svandragt avatar

Stargazers

 avatar

Watchers

 avatar  avatar

chassis_xhgui's Issues

Missing Flamegraph option

After freshly installing and provisioning the XHGui extension, I see Call Graphs but not Flame Graphs as an option when viewing the result of a prior run. I know that flame graphs used to be an option and I don't see any change to this repo that would have removed them, so I'm curious whether this is a bug

image

  1. What operating system do you use? 2. What version of Vagrant are you running? 3. Are you using VirtualBox or VMWare and which version are you using?
    Ubuntu 19.04; Vagrant 2.2.5; vbox 6.0.10

  2. Do you have a custom YAML file? If so, what does it contain?
    (Please paste in your chassis.local.yaml file)

hosts:
  - core.local

paths:
  content: content
  base: .
  wp: ../git/src # WP_PATH

synced_folders:
  ../git: /vagrant/wordpress-develop # REPO_PATH

extensions:
  - chassis/core_dev
  - chassis/xdebug
  - chassis/pretty_permalinks
  - chassis/xhprof
  - chassis/chassis_xhgui

php: 7.3
ide: VSCODE
permalink: '/%year%/%monthnum%/%postname%/'
  1. Do you have any Chassis other extensions installed? If so, what are they?
    See above

Conflicts with chassis/chassis_openssl

When the openssl chassis extension is active and the xhgui chassis extensions is added and the box is provisionsed; or when the box is destroyed and a new box is provisioned, the provisioning process fails with the followin error:

   default: /tmp/vagrant-puppet/manifests-846018e2aa141a5eb79a64b4015fc5f3 => /Users/sander/dev/_hm/core-sitemaps/puppet/manifests
==> default: Running provisioner: shell...
    default: Running: /var/folders/jj/tspv8xhj24xd0n92js2nz72r0000gn/T/vagrant-shell20191017-3818-1cq8itd.sh
==> default: Running provisioner: puppet...
==> default: Running Puppet with development.pp...
==> default: Error: Duplicate declaration: File[/etc/nginx/sites-available/sitemaps.local.d] is already declared in file /vagrant/extensions/chassis_xhgui/modules/chassis_xhgui/manifests/init.pp:100; cannot redeclare at /vagrant/extensions/chassis_openssl/modules/chassis_openssl/manifests/init.pp:9 on node sitemaps.local
==> default: Error: Duplicate declaration: File[/etc/nginx/sites-available/sitemaps.local.d] is already declared in file /vagrant/extensions/chassis_xhgui/modules/chassis_xhgui/manifests/init.pp:100; cannot redeclare at /vagrant/extensions/chassis_openssl/modules/chassis_openssl/manifests/init.pp:9 on node sitemaps.local
  1. What operating system do you use? MacOS Mojave

  2. What version of Vagrant are you running? 2.2.5

  3. Are you using VirtualBox or VMWare and which version are you using? Virtualbox 6.0.12

  4. Do you have a custom YAML file? If so, what does it contain?
    (Please paste in your chassis.local.yaml file)

# Install a list of extensions automatically
extensions:
  - chassis/chassis_openssl
  - chassis/chassis_xhgui
  - chassis/composer
  - chassis/memcache
  - chassis/nodejs
  - chassis/sequelpro
  - chassis/xdebug

disabled_extensions:
  - chassis/tester
  1. Do you have any Chassis other extensions installed? If so, what are they?
    See above

Recieving error on vagrant provision when adding to existing project

Yo, getting an error on vagrant provision after adding extension to config.yaml. Seems related to roborourke/chassis-openssl extension naming conflict. โค๏ธ

==> default: Running provisioner: shell...
    default: Running: /var/folders/ht/fbpddqwn1rgdpxhcsmh3cmr80000gn/T/vagrant-shell20180913-82823-5pzcla.sh
==> default: Running provisioner: puppet...
==> default: Running Puppet with development.pp...
==> default: Error: Duplicate declaration: File[/etc/nginx/sites-available/vagrant.local.d] is already declared in file /vagrant/extensions/chassis-openssl/modules/openssl-nginx/manifests/init.pp:6; cannot redeclare at /vagrant/extensions/chassis-xhgui/modules/chassis-xhgui/manifests/init.pp:98 on node vagrant.local
==> default: Error: Duplicate declaration: File[/etc/nginx/sites-available/vagrant.local.d] is already declared in file /vagrant/extensions/chassis-openssl/modules/openssl-nginx/manifests/init.pp:6; cannot redeclare at /vagrant/extensions/chassis-xhgui/modules/chassis-xhgui/manifests/init.pp:98 on node vagrant.local
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
  1. What operating system do you use?
    Mac OSX 10.13.6 High Sierra

  2. What version of Vagrant are you running?
    2.1.2

  3. Are you using VirtualBox or VMWare and which version are you using?
    5.2.16

  4. Do you have a custom YAML file? If so, what does it contain?
    (Please paste in your chassis.local.yaml file)

# Chassis Configuration
#
# This file is the default configuration for all projects. The fallback order of
# configuration files is:
#
# - project/content/config.local.yaml   (project-specific overrides)
# - project/content/config.yaml         (project-specific defaults)
# - project/config.local.yaml          (global overrides)
# - project/config.yaml                 (global defaults)

hosts:
    - vagrant.local

database:
    name: wordpress
    user: wordpress
    password: vagrantpassword
    prefix: wp_

apt_mirror: Yes
multisite: Yes
php: 7.0

extensions:
    - chassis/cavalcade
    - chassis/mailhog
    - chassis/memcache
    - chassis/sequelpro
    - chassis/tester
    - chassis/v8js
    - chassis/xdebug
    - chassis/elasticsearch
    - roborourke/chassis-openssl
    - chassis/chassis-xhgui
  1. Do you have any Chassis other extensions installed? If so, what are they?
    Just those listed above.

Update for the newest apt submodule

We need to change location to @location for the latest version of Puppet and we also need to update out apt resources to fix the following error:

default: Error: Evaluation Error: Error while evaluating a Resource Statement, Apt::Source[mongodb-org-4.0]:
default: has no parameter named 'key_server'
default: has no parameter named 'include_src' (file: /vagrant/extensions/chassis_xhgui/modules/chassis_xhgui/manifests/init.pp, line: 12) on node vagrant.local

This breaks functionality that relies on shutdown functions

This is an interesting bug: perftools/xhgui-collector#19

The most visible problem this causes is that Query Monitor doesn't work when Chassis-XHGui is in use, because it uses the shutdown action in WordPress, which is itself attached to a shutdown function which doesn't fire due to the above bug.

Opening this here for visibility and as a reminder that the fix will need to be pulled downstream.

Account for custom Chassis paths

Currently if I have Chassis in a subfolder e.g. chassis the nginx rules aren't accounting for this so we need to fix this. We will also need to update the readme to explain how this works as well.

When Chassis has PHP 7.2 defined, XHGui fails to install

Please see below:

[vagrant] ==> default: Notice: /Stage[main]/Chassis-xhgui/Apt::Source[mongodb-org-4.0]/Apt::Key[Add key: 9DA31620334BD75D9DCB49F368818C72E52529D4 from Apt::Source mongodb-org-4.0]/Apt_key[Add key: 9DA31620334BD75D9DCB49F368818C72E52529D4 from Apt::Source mongodb-org-4.0]/ensure: created
[vagrant] ==> default: Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php7.2-mongodb' returned 100: Reading package lists...
[vagrant] ==> default: Building dependency tree...
[vagrant] ==> default: Reading state information...
[vagrant] ==> default: E: Unable to locate package php7.2-mongodb
[vagrant] ==> default: E: Couldn't find any package by glob 'php7.2-mongodb'
[vagrant] ==> default: E: Couldn't find any package by regex 'php7.2-mongodb'
[vagrant] ==> default: Error: /Stage[main]/Chassis-xhgui/Package[php7.2-mongodb]/ensure: change from purged to latest failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php7.2-mongodb' returned 100: Reading package lists...
[vagrant] ==> default: Building dependency tree...
[vagrant] ==> default: Reading state information...
[vagrant] ==> default: E: Unable to locate package php7.2-mongodb
[vagrant] ==> default: E: Couldn't find any package by glob 'php7.2-mongodb'
[vagrant] ==> default: E: Couldn't find any package by regex 'php7.2-mongodb'

Because of the above error, when installing Chassis on a fresh install it fails to install Chassis at all because of the failed dependency error.

Missing step to start profiling?

First off, this is bonkers cool.

I got this set up on a project that is using a custom hostname and path (i.e., chassis in a subdirectory). I've got XHGui available at http://custom-path.local/chassis/xhgui, but it doesn't seem to be getting any data.

screen shot 2018-08-16 at 2 22 40 pm

Is there a missing step I need to take to begin profiling? And if so, can we update the README to include that step?

Use the composer dependency

When I originally wrote this extension we didn't have extension dependencies and we also didn't have the paths option in the composer extension. I think we should be able to use both of these configuration options to simplify this extension installation.

Not possible to install globally

I like this extension, so I tried to install this extension globally:

cd ~/.chassis/extensions
git clone --recursive [email protected]:Chassis/chassis_xhgui.git
cd $PROJECT; vagrant provision

No dependencies like xhprof and mongodb are installed. When adding the extension to the content/config.yaml file everything is installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.