PHPackages                             staabm/sysmonitor - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. staabm/sysmonitor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

staabm/sysmonitor
=================

1.1.0(1y ago)71.6M↓47.1%2MITPHPPHP ^7.0 || ^8.0

Since Nov 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/staabm/SysMonitor)[ Packagist](https://packagist.org/packages/staabm/sysmonitor)[ RSS](/packages/staabm-sysmonitor/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (1)Versions (26)Used By (0)

SysMonitor
==========

[](#sysmonitor)

Monitors a php app and sends notifications on certain error/exception/resource-exhausting/custom/etc. events.

The monitor checks the data you provide and decides with a naive default implementation (see `SystemMonitor#rateAndStore`) when things get urgent/severe. `SystemEvent`s are compared using a hash so times of occurence can also be based on similarity. Notifications are beeing send in such cases, depending on your used Notifier.

The default implementation of `SystemEventStorage` stores your data in a mix of APC and Memcached. Therefore it requires both php extensions.

Usage
=====

[](#usage)

init all the things. All classes prefixed with `My` need to be provided by the application/framework beeing monitored.

```
// sends notificaitons on urgent events
$notifier = new SeverityNotifier(new MyCustomNotifier(), SystemEvent::SEVERITY_URGENT);
// main class which collects all the data
$monitor = new SystemMonitor(new SystemEventStorage(), new MyRequestEnvImpl(), $notifier);
```

report performance-data from somewhere in your app (e.g. on request shutdown)

```
register_shutdown_function(function() {
    $requestStats = new RequestStatsEvent();
    // data from your db class
    $requestStats->usedQueries = DB::$num_of_queries;
    $requestStats->usedConnections = DB::$num_of_connections;
    // data from your runtime
    $requestStats->peakMemory = number_format(memory_get_peak_usage(true) / 1024 / 1024);

    // retrieve the monitor instance, e.g. via a DIC/a registry/singleton/whatever
    // $monitor = ..
    $monitor->collectStats($requestStats);
});
```

let the `Monitor` collect data about exceptions occured

```
set_exception_handler(function() {
    $event = new RequestExceptionEvent();
    $event->exception = $exception;

    // retrieve the monitor instance, e.g. via a DIC/a registry/singleton/whatever
    // $monitor = ..
    $monitor->collectException($event);
});
```

you could do the same for errors. To collect data of fatal errors there are some known workarounds which can be used (checking for `error_get_last()` in a shutdown function)

Sidenote
========

[](#sidenote)

This library was extracted out of a framework and contains some "strange" things which are kept for BC reasons. This will be changed in version 2.0.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 89.6% 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 ~155 days

Recently: every ~256 days

Total

25

Last Release

529d ago

Major Versions

v0.7 → v1.02020-12-02

PHP version history (3 changes)v0.1PHP &gt;=5.2.0

v0.7PHP ^7.0

1.0.1PHP ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/99d4e5e5fa8fb7d0782de39b43c558953d0a5881a7ba596b90ed9c312db8c4d9?d=identicon)[staabm](/maintainers/staabm)

---

Top Contributors

[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (60 commits)")[![clxmstaab](https://avatars.githubusercontent.com/u/47448731?v=4)](https://github.com/clxmstaab "clxmstaab (5 commits)")[![clxswalther](https://avatars.githubusercontent.com/u/22363607?v=4)](https://github.com/clxswalther "clxswalther (1 commits)")[![pndongo](https://avatars.githubusercontent.com/u/101555521?v=4)](https://github.com/pndongo "pndongo (1 commits)")

### Embed Badge

![Health badge](/badges/staabm-sysmonitor/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M342](/packages/open-telemetry-sdk)

PHPackages © 2026

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