Download the PHP package perftools/php-profiler without Composer

On this page you can find all versions of the php package perftools/php-profiler. 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 php-profiler

PHP Profiler

A PHP profiling library to submit profilings to XHGui.

Supported profilers:

This profiling library will auto-detect any supported profiler and use that. The specific profiler can be chosen by profiler config key.

Goals

Usage

In order to profile your application, you need to:

Installation

The supported way to install this package is via composer:

Create profiler

Creating profiler would be something like this:

If you need to disable profiler doing flush, session_write_close and fastcgi_finish_request at the end of profiling, pass false to register shutdown handler:

Using config file

You can create config/config.php and load config from there:

  1. copy config/config.default.php to config/config.php
  2. use Config::create() to new Profiler

Advanced Usage

You might want to control capture and sending yourself, perhaps modify data before sending.

Autoloader

To be able to profile autoloader, this project provides autoload.php that loads classes needed to start up the profiler.

Load it before loading composer autoloader:

Loading composer autoloader is still needed when saving results to MongoDB or PDO directly.

Config

Reference config of what can be configured:

It includes all configuration options and inline documentation about the options.

Savers

To deliver captured data to XHGui, you will need one of the savers to submit to the datastore XHGui uses.

Stack saver

Allows saving to multiple handlers.

The example config configures to use Upload Saver, and if that fails, save to File Saver:

Upload saver

This is the recommended saver as it's the easiest to set up.

Example config:

File saver

If your site cannot directly connect to your XHGui instance, you can choose to save your data to a temporary file for a later import to XHGui.

Example config:

To import a saved files, see Import jsonl files section.

MongoDB Saver

NOTE: Saving directly to MongoDB is discouraged, use Upload/File/Stack saver instead.

For saving directly to MongoDB you would need ext-mongo for PHP 5 and ext-mongodb with alcaeus/mongo-php-adapter package for PHP 7 along with perftools/xhgui-collector package:

for PHP 5:

for PHP 7:

Example config:

PDO Saver

NOTE: Saving directly to PDO is discouraged, use Upload/File/Stack saver instead.

PDO Saver should be able to save to any PDO driver connection.

You will need to install additionally perftools/xhgui-collector package:

Example config:

Custom Saver

You can create your own profile saver by implementing SaverInterface and calling setSaver().

Import jsonl files

You can use ./bin/import.php script to submit files saved by File Saver to XHGui server.

  1. Setup config file
  2. Configure to use Upload Saver
  3. Execute the ./bin/import.php script

The script can take multiple jsonl formatted files, or if none given read stdin stream.

Configure Profiling Rate

You may want to change how frequently you profile the application. The profiler.enable configuration option allows you to provide a callback function that specifies the requests that are profiled.

The following example configures to profile 1 in 100 requests, excluding requests with the /blog URL path:

In contrast, the following example instructs to profile every request:

Profile using XHProf helper

If you want to start profiling using a browser based tool like XHProf helper, You can use this method:

Configure 'Simple' URLs Creation

This library generates 'simple' URLs for each profile collected. These URLs are used to generate the aggregate data used on the URL view. Since different applications have different requirements for how URLs map to logical blocks of code, the profile.simple_url configuration option allows you to provide the logic used to generate the simple URL.

By default, all numeric values in the query string are removed.

Configure ignored functions

You can use the profiler.options configuration value to set additional options for the profiler extension. This is useful when you want to exclude specific functions from your profiler data:

In addition, if you do not want to profile all PHP built-in functions, Add ProfilingFlags::NO_BUILTINS, to 'profiler.flags'.

Installing profilers

For this library to capture profiling data, you would need any of the profiler extension. Depending on your environment (PHP version), you may need to install different extension.

Supported profilers:

Tideways XHProf (5.+)

Tideways XHProf v5.x requires PHP >= 7.0.

To install tideways_xhprof extension, see their installation documentation.

Alternatively on brew (macOS) you can use packages from kabel/pecl tap:

For outdated php versions few recipes exist in glensc/tap tap:

XHProf

XHProf supports all PHP versions.

for PHP 5.x:

for PHP >=7.0:

Alternatively on brew (macOS) you can use packages from kabel/pecl tap:

Tideways (4.x)

Tideways 4.x extension requires with PHP >= 7.0.

To install tideways extension, see their installation documentation.

UProfiler

UProfiler requires PHP >= 5.3, < PHP 7.0

To install uprofiler extension, see their installation documentation.


All versions of php-profiler with dependencies

PHP Build Version
Package Version
Requires php Version ^5.3.0 || ^7.0 || ^8.0
ext-json Version *
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/php-profiler contains the following files

Loading the files please wait ....