Download the PHP package marfatech/liveprof without Composer

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

Live Profiler

Live Profiler is a system-wide performance monitoring system in use at Badoo that is built on top of XHProf or its forks (Uprofiler or Tideways). Live Profiler continually gathers function-level profiler data from production tier by running a sample of page requests under XHProf.

Live profiler UI then aggregates the profile data corresponding to individual requests by various dimensions such a time, page type, and can help answer a variety of questions such as: What is the function-level profile for a specific page? How expensive is function "foo" across all pages, or on a specific page? What functions regressed most in the last day/week/month? What is the historical trend for execution time of a page/function? and so on.

Here is a plugin for PhpStorm to see the method performance directly in IDE.

liveprof.org shows all features and can be used for test purposes.

Build Status codecov Scrutinizer Code Quality GitHub license

System Requirements

Installation

  1. You can install Live Profiler via Composer:

  2. Prepere a storage for results depends on mode

[save data in database] If you use DB mode you need to prepare a database server. You can use any driver described here or implement the custom one. You need run a script to configure database. This script creates "details" table:

[save data in files] It's also possible to save profiling result into files. To do it prepare a directory with write permissions.

[send data to demo site] You need to visit liveprof.org , sign in and copy API key.

  1. Init a profiler before working code in the project entry point (usually public/index.php).

Usage

There is an example of usage a profiler with default parameters:

There is an example how to test Live Profiler without any extension and database. You can use a build-in profiler compatible with XHProf and liveprof.org as UI:

There is a full list of methods you can use to change options:

If you want to change the Label during running (for instance, after you got some information in the router or controller) you can call:

if you don't want to save profiling result you can reset it anytime:

After script ends it will call \MarfaTech\LiveProfiler\LiveProfiler::getInstance()->end(); on shutdown, but you can call it explicitly after working code.

Environment Variables

LIVE_PROFILER_CONNECTION_URL: url for the database connection

LIVE_PROFILER_PATH: path to save profiles in \MarfaTech\LiveProfiler\LiveProfiler::MODE_FILES mode

LIVE_PROFILER_API_URL: api url to send profiles in \MarfaTech\LiveProfiler\LiveProfiler::MODE_API mode and see demo on liveprof.org

Work flow

Live profiler allows to run profiling with custom frequency (for instance 1 of 1000 requests) grouped by app name ('Default' by default) and custom label (by default it's the url path or script name).

It's important to calculate the request divider properly to have enough data for aggregation. You should divide daily request count to have approximately 1 profile per minute. For instance, if you have 1M requests a day for the page /users the divider should be 1000000/(60*24) = 694, so divider = 700 is enough.

Also you have to calculate a total divider for all request profiling. It's important to control the whole system health. It can be calculated the same way as a divider calculation for particularly request, but in this case you should use count of all daily requests. For instance, if you have 10M requests a day - total_divider=10000000/(60*24) = 6940, so total_divider = 7000 is enough.

The profiler automatically detects which profiler extension you have (xhprof, uprofiler or tidyways). You have to set profiler callbacks if you use other profiler.

You can run the test script in the docker container with xhprof extension and look at the example of the server configuration in Dockerfile:

or you can build a docker container with xhprof using sampling:

or you can build a docker container with tideways extension:

or uprofiler extension:

or latest hhvm with included xhprof extension:

or if you want to use API with included xhprof extension:

If your server has php version 7.0 or later it's better to use Tideways as profiler.

Steps to install tideways extension:

Steps to install uprofiler:

Tests

Install Live Profiler with dev requirements:

In the project directory, run:

License

This project is licensed under the MIT open source license.


All versions of liveprof with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
doctrine/dbal Version ~2.0|~3.0
psr/log Version ~1.0|~2.0|~3.0
ext-json Version *
ext-zlib Version *
ext-curl 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 marfatech/liveprof contains the following files

Loading the files please wait ....