Download the PHP package wikimedia/arc-lamp without Composer

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

Packagist

Arc Lamp

Arc Lamp helps gather stack traces from a running PHP 7 application and publish them in the form of flame graphs and trace logs.

See performance.wikimedia.org for a live example.

Prerequisites

Client:

Processor:

Quick start

To automatically enable this for all web requests and entry points, you can use the PHP auto_prepend_file option. See Wikimedia's own configuration for example.

How it works

See also: Profiling PHP in production on Wikimedia Techblog.

The Arc Lamp pipeline comprises of three stages:

  1. Capture stack traces.
  2. Create trace logs.
  3. Generate flame graphs.

Capture stack traces

The php-excimer extension is used to periodically collect a backtrace. It has no run-time overhead by default. When enabled from a web request, it periodically schedules a graceful interrupt at which point it captures a backtrace.

These traces can be collected from a PHP callback and dispatched to a socket or file as-needed.

The default in ArcLamp.php is to send the trace to a Redis pubsub channel.

Arc Lamp was originally created in 2014 for Xenon, a sampling profiler native to the HHVM engine for PHP. To use Arc Lamp with HHVM Xenon, see arc-lamp v1.0 instead.

Create trace logs

In Wikimedia's production cluster, Arc Lamp's Redis server resides in the high availability "Tier 1" zone, and thus kept separate from offline performance, research, and statistics services ("Tier 2").

Each of the production web servers uses the ArcLamp::collect client in PHP to send traces to Redis.

The arclamp-log service subscribes to the Redis pubsub channel, normalizes the stack traces and write them to the relevant trace log files. The example configuration creates a trace log file for each hour and each day.

Within those two time periods, it segregates the trace logs by entry point of the PHP application.

For example, the MediaWiki application has index.php, and rest.php (web) and RunJobs.php (CLI) entry points. This results in the following trace logs:

The arclamp-log service is also responsible for pruning trace logs older than the configured retention period.

Generate flame graphs

The arclamp-generate-svgs script runs at a regular interval and creates or updates the flame graph associated with each trace log file. It also maintains a reverse version of each flame graph.

For example:

The arclamp-generate-svgs script also removes graphs for which a trace log no longer exists.

Flamegraphs are generated using Brendan Gregg's flamegraph.pl.

Demo

See performance.wikimedia.org for a live example.


All versions of arc-lamp with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-redis 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 wikimedia/arc-lamp contains the following files

Loading the files please wait ....