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.5M—0.7%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 1mo 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

50

—

FairBetter than 96% of packages

Maintenance42

Moderate activity, may be stable

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

483d 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.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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