Download the PHP package perftools/xhgui without Composer

On this page you can find all versions of the php package perftools/xhgui. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package xhgui

XHGui

A graphical interface for XHProf profiling data that can store the results in MongoDB or PDO database.

Application is profiled and the profiling data is transferred to XHGui, which takes that information, saves it in MongoDB (or PDO database), and provides a convenient GUI for working with it.

This project is the GUI for showing profiling results, to profile your application, use specific minimal library:

Build Status Scrutinizer Code Quality Code Coverage

System Requirements

XHGui has the following requirements:

If you need to decide which backend to use, you can check the compatibility matrix what features are implemented or missing per backend.

MongoDB

The default installation uses MongoDB database. Most of the documentation speaks about MongoDB.

PDO

Any of the drivers and an accompanying database:

NOTE: PDO may not support all the features of XHGui, see #320.

Installation from source

  1. Clone or download xhgui from GitHub.

  2. Point your webserver to the webroot directory.

  3. Set the permissions on the cache directory to allow the webserver to create files. If you're lazy, 0777 will work.

    The following command changes the permissions for the cache directory:

  4. Start a MongoDB instance. XHGui uses the MongoDB instance to store profiling data.

  5. If your MongoDB setup uses authentication, or isn't running on the default port and localhost, update XHGui's config/config.php so that XHGui can connect to your mongod instance.

  6. (Optional, but recommended) Add indexes to MongoDB to improve performance.

    XHGui stores profiling information in a results collection in the xhprof database in MongoDB. Adding indexes improves performance, letting you navigate pages more quickly.

    To add an index, open a mongo shell from your command prompt. Then, use MongoDB's db.collection.ensureIndex() method to add the indexes, as in the following:

  7. Install dependencies with composer

  8. Set up your webserver. The Configuration section below describes how to setup the rewrite rules for both nginx and apache.

Installation with Docker

This setup uses docker-compose to orchestrate docker containers.

  1. Clone or download xhgui from GitHub.

  2. Startup the containers: docker-compose up -d

  3. Open your browser at http://xhgui.127.0.0.1.xip.io:8142 or just http://localhost:8142 or type at terminal composer open

  4. To customize xhgui, copy config/config.default.php to config/config.php and edit that file.

  5. To customize docker-compose, copy docker-compose.yml to docker-compose.override.yml and edit that file.

Configuration

Configure Webserver Re-Write Rules

XHGui prefers to have URL rewriting enabled, but will work without it. For Apache, you can do the following to enable URL rewriting:

  1. Make sure that an .htaccess override is allowed and that AllowOverride has the directive FileInfo set for the correct DocumentRoot.

    Example configuration for Apache 2.4:

  2. Make sure you are loading up mod_rewrite correctly. You should see something like:

  3. XHGui comes with a .htaccess file to enable the remaining rewrite rules.

For nginx and fast-cgi, you can use the following snippet as a start:

Profiling a Web Request or CLI script

The supported way to profile an application is to use perftools/php-profiler package.

You can use that package to collect data from your web application or a CLI script.

This data is then pushed into XHGui database where it can be viewed with XHGui application.

The php-profiler package offers submitting data directly to XHGui instance once the profiling is complete at the end of the request.

If the application cannot directly connect to XHGui instance, the package offers solution to capture profiling data to a file which you can import later using the import script.

Warning: Importing the same file twice will create duplicate profiles.

Limiting MongoDB Disk Usage

Disk usage can grow quickly, especially when profiling applications with large code bases or that use larger frameworks.

To keep the growth in check, configure MongoDB to automatically delete profiling documents once they have reached a certain age by creating a TTL index.

Decide on a maximum profile document age in seconds: you may wish to choose a lower value in development (where you profile everything), than production (where you profile only a selection of documents). The following command instructs Mongo to delete documents over 5 days (432000 seconds) old.

Waterfall Display

The goal of XHGui's waterfall display is to recognize that concurrent requests can affect each other. Concurrent database requests, CPU-intensive activities and even locks on session files can become relevant. With an Ajax-heavy application, understanding the page build is far more complex than a single load: hopefully the waterfall can help. Remember, if you're only profiling a sample of requests, the waterfall fills you with impolite lies.

Some Notes:

Monitoring

Prometheus metrics suitable for monitoring service health are exposed on /metrics. (This currently only works if using PDO for storage.)

Compatibility matrix

Feature MongoDB PDO
Prometheus exporter #305
Searcher::latest()
Searcher::query() #384
Searcher::get()
Searcher::getForUrl() #436
Searcher::getPercentileForUrl() #436
Searcher::getAvgsForUrl() #384
Searcher::getAll(sort) #436
Searcher::getAll(direction) #436
Searcher::delete()
Searcher::truncate()
Searcher::saveWatch() #435
Searcher::getAllWatches() #435
Searcher::truncateWatches() #435
Searcher::stats() #305
Searcher::getAllServerNames() #460

Releases / Changelog

See the releases for changelogs, and release information.

License

Copyright (c) 2013 Mark Story & Paul Reinheimer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of xhgui with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ~8.0 || ~8.1
ext-json Version *
alcaeus/mongo-php-adapter Version ^1.1
pimple/pimple Version ^3.0
slim/flash Version ^0.4.0
slim/slim Version ^3.12
slim/twig-view Version ^2.5
symfony/options-resolver Version ^3.3
twig/twig Version ^1.26
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package perftools/xhgui contains the following files

Loading the files please wait ....