PHPackages                             koalamer/tideways-xhprof-free-scheduler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. koalamer/tideways-xhprof-free-scheduler

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

koalamer/tideways-xhprof-free-scheduler
=======================================

A convenience class for integrating the free version of Tideways' Xhprof extension into your code.

v0.1.0(5y ago)02MITPHPPHP ^7

Since Nov 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/koalamer/tideways-xhprof-free-scheduler)[ Packagist](https://packagist.org/packages/koalamer/tideways-xhprof-free-scheduler)[ RSS](/packages/koalamer-tideways-xhprof-free-scheduler/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

tideways-xhprof-free-scheduler
==============================

[](#tideways-xhprof-free-scheduler)

A small helper class to integrate the free Tideways XHProf Extension edition into your code.

How to Use
----------

[](#how-to-use)

### Set Up the tideways\_xhprof Extension

[](#set-up-the-tideways_xhprof-extension)

You can find the source and precompiled packages, as well as installation instructions at [github.com/tideways/php-xhprof-extension](https://github.com/tideways/php-xhprof-extension).

### Use the class name in your script

[](#use-the-class-name-in-your-script)

You can have the class autoloaded, but if you want to include the autoloading routine in the measurement, you should include the source file directly and start the profiling before including the autoloader.

```
use koalamer\Tideways\TidewaysXhprofFreeScheduler;
```

### Set how often to start profiling

[](#set-how-often-to-start-profiling)

Setting the value X will result in a 1 in X chance for the profiling to start. Setting it to less than 1 rwsults in never starting the profiler. The default value is 0, which means no profiling.

```
TidewaysXhprofFreeScheduler::setStartingChanceDivisor(100);
```

### Start the actual profiling

[](#start-the-actual-profiling)

The init() call will use the current value of the starting chance divisor to determine whether to actually start profiling or not.

Once the profiling was started, subsequent calls return without doing anything.

For example: in a single entry point scenario you can set a low starting chance globally, call init(), and later set a higher starting chance for code (module/routine/action) you know run less often, and call init() again. This way you can capture profile information on parts of your code that would otherwise have a low chance of being profiled, but still have a global setting, without the two interfering with eachother.

If the tideways\_xhprof extension is not loaded, the call returns false, otherwise true.

```
TidewaysXhprofFreeScheduler::init()
```

### Set the log file path by defining segmentation dimensions

[](#set-the-log-file-path-by-defining-segmentation-dimensions)

You can set the log file path by defining segmentation. Each level of segmentation corresponds to a directory level. The key-value pairs you provide are only evaluated when the profiling stops, so you can define and redefine segmentation levels throughout your code.

The profiling stops when the script shuts down. The collection of segmentation parameters is then sorted by key and imploded, so the keys you use matter.

If you provide an empty string as the value, that value will be replaced by the string "empty".

For example, defining these segmentations:

```
TidewaysXhprofFreeScheduler::setSegmentation("1-host", gethostname())
TidewaysXhprofFreeScheduler::setSegmentation("3-module", "awesome-module")
TidewaysXhprofFreeScheduler::setSegmentation("2-day", date("Y-m-d"))
TidewaysXhprofFreeScheduler::setSegmentation("0-root","/tmp")
TidewaysXhprofFreeScheduler::setSegmentation("4-action","")
```

will result in a log file path "/tmp/some-hostname/2020-11-03/awesome-module/empty/".

### Writing out the log file

[](#writing-out-the-log-file)

The profiling stops when the internal singleton class instance is destroyed, and thus it is automatic.

The log file name itself will be the current time in the form of date, time and microsecs like this: "20201103\_064423\_032472.json".

The log path directories will be created as needed to house the log file.

### Reading the Profile Logs

[](#reading-the-profile-logs)

To evaluate the produced logs, use the Tideways Toolkit, which can be found at [github.com/tideways/toolkit](https://github.com/tideways/toolkit).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2015d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2f97adcb00fd599e8eba233e862b4ad7a7047f467d4a31372fb18168100f686?d=identicon)[koalamer](/maintainers/koalamer)

### Embed Badge

![Health badge](/badges/koalamer-tideways-xhprof-free-scheduler/health.svg)

```
[![Health](https://phpackages.com/badges/koalamer-tideways-xhprof-free-scheduler/health.svg)](https://phpackages.com/packages/koalamer-tideways-xhprof-free-scheduler)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
