PHPackages                             mini-monitor/php\_monitor - 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. mini-monitor/php\_monitor

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

mini-monitor/php\_monitor
=========================

A php\_monitor sdk

1.0.3(7y ago)221MITPHP

Since Nov 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Michael-LiK/php_monitor)[ Packagist](https://packagist.org/packages/mini-monitor/php_monitor)[ RSS](/packages/mini-monitor-php-monitor/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (6)Used By (0)

[![](https://camo.githubusercontent.com/6cad19d80a7a9b6bb162b962d22b4bdb0c2094242eefa4c56e32c6c5cd9f0b40/687474703a2f2f63646e2e6368696e616e616c616e2e636f6d2f6d696e692d6c6f676f2e6a7067)](https://camo.githubusercontent.com/6cad19d80a7a9b6bb162b962d22b4bdb0c2094242eefa4c56e32c6c5cd9f0b40/687474703a2f2f63646e2e6368696e616e616c616e2e636f6d2f6d696e692d6c6f676f2e6a7067)

 mini-monitor
==============

[](#-mini-monitor-)

 A monitor php

[![Build Status](https://camo.githubusercontent.com/f2781fc6868f675404b5f2f122799078415abbd227c5cde61b2ee2b81f1bb4c2/68747470733a2f2f7472617669732d63692e6f72672f4d69636861656c2d4c694b2f7068705f6d6f6e69746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Michael-LiK/php_monitor)[![Latest Stable Version](https://camo.githubusercontent.com/56701950b2c99fd67effd756487659e8e2ec1dcc4b8d629b9c49b7e72d78e9d2/68747470733a2f2f706f7365722e707567782e6f72672f6d696e692d6d6f6e69746f722f7068705f6d6f6e69746f722f762f737461626c65)](https://packagist.org/packages/mini-monitor/php_monitor)[![Total Downloads](https://camo.githubusercontent.com/d61c284c86c1df0da7c2755a792e92da70b3972de98b7163d1898891e71dd654/68747470733a2f2f706f7365722e707567782e6f72672f6d696e692d6d6f6e69746f722f7068705f6d6f6e69746f722f646f776e6c6f616473)](https://packagist.org/packages/mini-monitor/php_monitor)[![Latest Unstable Version](https://camo.githubusercontent.com/82a82ce0dfdac7e0d08a23f1a48e881f7720f2e461a278d90d9ade82c32482ec/68747470733a2f2f706f7365722e707567782e6f72672f6d696e692d6d6f6e69746f722f7068705f6d6f6e69746f722f762f756e737461626c65)](https://packagist.org/packages/mini-monitor/php_monitor)[![License](https://camo.githubusercontent.com/c7818aa0a09be686931bcb78ba2dd403b6f0d24bcb5d7a7b1c04b3e3c9b4694b/68747470733a2f2f706f7365722e707567782e6f72672f6d696e692d6d6f6e69746f722f7068705f6d6f6e69746f722f6c6963656e7365)](https://packagist.org/packages/mini-monitor/php_monitor)

---

中文文档

项目背景
----

[](#项目背景)

目前市面上大多数监控是针对服务器的CPU、内存占用率、网络流量等，这一些都是偏运维层面的监控。

对开发人员来说，大家更关注自己的服务是否有挂、业务被调用的次数，如果是有条件的调用还需要关注调用的返回值统计、成功和失败的次数等。

现有的成熟解决方案主要有两种，一是通过日志分析，在服务中进行埋点，后期进行日志分析。第二种是通过业务调用时进行上报。这两种方案都可以满足需求，但同时也存在着各自的不足，日志分析的方式较难配置。第二种业务上报模式多是通过每次调用时进行上报，这也占用了大量的带宽资源，当访问量过大时，这样的上报对监控收集端来说相对于巨大的DDOS攻击，简直堪比灾难。

基于这样的背景，我进行了本次项目的开发，以应对日常开发对业务可用性的关注。

解决方案：

将上报数据暂存到服务器内存，将此服务器的所有上报数据通过定时脚本，每分钟上报一次，减少网络资源占用。

技术选型：采用 php\_monitor + influxdb + grafana

功能分配：

php\_monitor:负责业务的上报与收集。

influxd:时序性数据库 负责监控数据的持久化。

grafana:是一个开源的度量分析和可视化套件。 负责监控数据的可视化，同时可配置 email和dingding机器人等报警。

依赖
--

[](#依赖)

php 7.0+ 同时需开启php内置扩展sysvsem、sysvshm

安装
--

[](#安装)

```
$ composer require mini-monitor/php_monitor dev-master
```

使用方式
----

[](#使用方式)

这里有三种功能你可以使用。

例子:

1.为上报数据加一

```
add($key)
```

2.为上报数据增加指定值

```
addValue($key,$value)
```

3.为上报数据设置指定值

```
set($key,$value)
```

\##接下来要做的是

1.增加服务端进行数据收集。 2.完善项目文档。

一起创造
----

[](#一起创造)

你可以通过一下几种方式进行代码贡献。

1. 通过这个链接提交问题 [issue tracker](https://github.com/monitor/php/issues).
2. 帮助解答已存在的相应问题 [issue tracker](https://github.com/monitor/php/issues).
3. 提交新的功能并更新文档.

本人开发经验较少，可能会存在很多不足，敬请谅解。

协议
--

[](#协议)

本开源项目遵守MIT协议

---

English Doc

Installing
----------

[](#installing)

```
$ composer require mini-monitor/php_monitor dev-master
```

Usage
-----

[](#usage)

There are three functions you can use .

example:

Add one to on the key

```
add($key)
```

To add a value of key

```
addValue($key,$value)
```

To set a value of key

```
set($key,$value)
```

\##TODO LISTS

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/monitor/php/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/monitor/php/issues).
3. Contribute new features or update the wiki.

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

4

Last Release

2723d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31ce354eb4b309fb4e93b92b756bb02df6bc97414d1c7bab0107bb6c504f6a86?d=identicon)[Michael-LiK](/maintainers/Michael-LiK)

---

Top Contributors

[![Michael-LiK](https://avatars.githubusercontent.com/u/15011515?v=4)](https://github.com/Michael-LiK "Michael-LiK (38 commits)")

### Embed Badge

![Health badge](/badges/mini-monitor-php-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/mini-monitor-php-monitor/health.svg)](https://phpackages.com/packages/mini-monitor-php-monitor)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[marvinlabs/laravel-discord-logger

Logging to a discord channel in Laravel

2081.1M2](/packages/marvinlabs-laravel-discord-logger)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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