PHPackages                             ilyaplot/pulse - 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. [Framework](/categories/framework)
4. /
5. ilyaplot/pulse

AbandonedArchivedLibrary[Framework](/categories/framework)

ilyaplot/pulse
==============

A healthcheck framework for PHP

2.0.2(3y ago)112MITPHPPHP ^8.1

Since Feb 24Pushed 3y agoCompare

[ Source](https://github.com/ilyaplot/pulse)[ Packagist](https://packagist.org/packages/ilyaplot/pulse)[ GitHub Sponsors](https://github.com/ilyaplot)[ Patreon](https://www.patreon.com/ilyaplot)[ RSS](/packages/ilyaplot-pulse/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Pulse
=====

[](#pulse)

Pulse allows you to easily write healthchecks for your application and display a simple, aggregated report so you can quickly diagnose whether and why your app is having trouble (or whether you can blame someone else). You can also monitor your healthchecks with [nagios](http://www.nagios.org/), [zabbix](http://www.zabbix.com/), etc.

[![Packagist Version](https://camo.githubusercontent.com/2ac656e6719b9879e9deb9ad4a4ff14a04d3bf7e2129f116e1e6dc4138b3d389/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c7961706c6f742f70756c73653f6c6162656c3d72656c65617365267374796c653d706c6173746963)](https://camo.githubusercontent.com/2ac656e6719b9879e9deb9ad4a4ff14a04d3bf7e2129f116e1e6dc4138b3d389/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c7961706c6f742f70756c73653f6c6162656c3d72656c65617365267374796c653d706c6173746963)[![GitHub last commit](https://camo.githubusercontent.com/165dbde39384bb80ccec8a958731869a6cfb8b19fcad91f764e43b255dd1f837/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f696c7961706c6f742f70756c7365)](https://camo.githubusercontent.com/165dbde39384bb80ccec8a958731869a6cfb8b19fcad91f764e43b255dd1f837/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f696c7961706c6f742f70756c7365)[![Code Coverage](https://camo.githubusercontent.com/606f5d2baf8f73d9db80853f2b2c57eab84ac28fef9bcacaa78a3df8ef57f1e3/68747470733a2f2f636f6465636f762e696f2f67682f696c7961706c6f742f70756c73652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ilyaplot/pulse)[![Psalm Level](https://camo.githubusercontent.com/2ca05125009944e817983717382adc2400598ccb0ff5ce3df4a6dfaece7577b5/68747470733a2f2f73686570686572642e6465762f6769746875622f696c7961706c6f742f70756c73652f6c6576656c2e737667)](https://shepherd.dev/github/ilyaplot/pulse)[![Type Coverage](https://camo.githubusercontent.com/8a4d593ca52f80fc917c65460d8acc00c3ff7941916a5b1eac9f362bb6f4b083/68747470733a2f2f73686570686572642e6465762f6769746875622f696c7961706c6f742f70756c73652f636f7665726167652e737667)](https://shepherd.dev/github/ilyaplot/pulse)[![Static Analysis](https://github.com/ilyaplot/pulse/workflows/static%20analysis/badge.svg)](https://github.com/ilyaplot/pulse/actions?query=workflow%3A%22static+analysis%22)[![Unit Tests](https://github.com/ilyaplot/pulse/workflows/tests/badge.svg)](https://github.com/ilyaplot/pulse/actions?query=workflow%3A%22tests%22)[![Style CI](https://camo.githubusercontent.com/f5e03e3a95a2cce57688ec4f279d028c64aaf62fc012954abb96387d5f728dbc/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3630353934313130312f736869656c64)](https://github.styleci.io/repos/605941101)[![PHP Version](https://camo.githubusercontent.com/1b2de809f0c60d74926d2a57ccac5dd797d7916f5c20a7df18b835206cec4b68/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f696c7961706c6f742f70756c73652f706870)](https://camo.githubusercontent.com/1b2de809f0c60d74926d2a57ccac5dd797d7916f5c20a7df18b835206cec4b68/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f696c7961706c6f742f70756c73652f706870)[![GitHub code size in bytes](https://camo.githubusercontent.com/e44f87c5b26a4e1f989ba3d74d124bff1418d23c5681c1ced7d2d07cf19baf3d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f696c7961706c6f742f70756c7365)](https://camo.githubusercontent.com/e44f87c5b26a4e1f989ba3d74d124bff1418d23c5681c1ced7d2d07cf19baf3d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f696c7961706c6f742f70756c7365)

#### Wait, what's a healthcheck?

[](#wait-whats-a-healthcheck)

Healthchecks are a great way to test system health and connectivity to other services. For example, you can verify connectivity to memcache or mysql, that your app can read / write to certain files, or that your API key for a third-party service is still working.

Installation
------------

[](#installation)

You can install this into your project using [composer](http://getcomposer.org/doc/00-intro.md#installation-nix). Create a `composer.json` file in the root of your project and add the following:

```
composer require ilyaplot/pulse

```

Include `vendor/autoload.php`, and you're off to the races!

#### Warnings

[](#warnings)

For non-critical checks you can use a warning and you'll get status 200 even if these fail. Use these to see when your app is experiencing service degredation but is still available. Warning checks must return boolean `true` or `false`.

```
$pulse->addWarning(new ClosureRule(
    fn() => (new YoutubeClient())->isUp(),
    "Verify connectivity to youtube",
    LevelEnum::warning,
));
```

#### Information

[](#information)

```
$pulse->addInfo(new ClosureRule(
    fn() => (new YoutubeClient())->isUp(),
    "Verify connectivity to youtube",
));

$pulse->addInfo(new ClosureRule(
    function(ClosureRule $closureRule) {
        $this->setErrorMessage( date('l'));
        return false;
    },
    "Today is",
));

$result = $pulse->run();
```

#### Custom Rules

[](#custom-rules)

You can also create your own custom rules by extending the `ilyaplot\pulse\rules\AbstractRule` class or implementing `ilyaplot\pulse\rules\RuleInterface`. For example, you could create a rule that checks that your app can connect to a third-party service.

```
class YoutubeRule extends AbstractRule
{
    public function __construct(
        private readonly string $apiKey,
    ) {
        $this->description = 'Verify connectivity to youtube';
        $this->level = LevelEnum::warning;
    }

    public function run(): bool
    {
        $youtubeClient = new YoutubeClient($this->apiKey);
        try {
            return $youtubeClient->isUp(); // bool
        } catch (AuthenticationException) {
            $this->setErrorMessage('Invalid API key');
            return false;
        }
    }
}
```

Then you can add it to your healthcheck:

```
$pulse->add(new YoutubeRule('your-api-key-1'));
$pulse->add(new YoutubeRule('your-api-key-2'));
```

#### Examples

[](#examples)

You can see some very basic example healthchecks in `examples/cli-usage.php` and `examples/http-usage.php`.

```
$pulse = new ilyaplot\pulse\Pulse();

$pulse->add(new FileRule(
    '/path/to/your/config/file',
    description: "Check that config file is readable",
    checkIsReadable: true,
));

include '/path/to/your/config/file';

$pulse->addCritical(new ClosureRule(
    function() use ($config) {
        $memcache = new Memcache();
        if(!$memcache->connect($config['memcache_host'], $config['memcache_port'])){
            return false;
        }
        $key = 'healthcheck_test_key'
        $msg = 'memcache is working';
        $memcache->set($key, $msg);
        return $memcache->get($key) === $msg;
    },
    "Check memcache connectivity"
));
```

Does Pulse Work With X?
-----------------------

[](#does-pulse-work-with-x)

Yep. Pulse is designed to be self-contained and is very simple, so it doesn't require you to use any particular framework. You are free to include other things like yml parsers, etc. if you choose, but we recommend NOT including a full framework stack on top of it. If the framework fails to load for some reason, your healthchecks won't be displayed, meaning they're not useful for diagnosing whatever problem you've encountered.

Won't This Expose Information About My App?
-------------------------------------------

[](#wont-this-expose-information-about-my-app)

Potentially. You *probably* don't want to display the healthcheck results to the public. Instead, you could [whitelist certain IPs](http://httpd.apache.org/docs/2.2/howto/access.html).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77% of commits — single point of failure

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

Every ~0 days

Total

2

Last Release

1226d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1800a49853ebe6fce048544e1b54b24bebdcebb4b58d672af1fc6abf99e7d69d?d=identicon)[ilyaplot](/maintainers/ilyaplot)

---

Top Contributors

[![cbednarski](https://avatars.githubusercontent.com/u/649798?v=4)](https://github.com/cbednarski "cbednarski (47 commits)")[![ilyaplot](https://avatars.githubusercontent.com/u/641257?v=4)](https://github.com/ilyaplot "ilyaplot (12 commits)")[![stephenmcm](https://avatars.githubusercontent.com/u/2093185?v=4)](https://github.com/stephenmcm "stephenmcm (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ilyaplot-pulse/health.svg)

```
[![Health](https://phpackages.com/badges/ilyaplot-pulse/health.svg)](https://phpackages.com/packages/ilyaplot-pulse)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M297](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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