PHPackages                             mathiasgrimm/netwatch - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mathiasgrimm/netwatch

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mathiasgrimm/netwatch
=====================

Network service latency probing tool for PHP — measures Redis, PostgreSQL, MySQL, S3, HTTP endpoints with statistical analysis

0186↑20%PHPCI passing

Since Mar 19Pushed 3mo agoCompare

[ Source](https://github.com/mathiasgrimm/netwatch)[ Packagist](https://packagist.org/packages/mathiasgrimm/netwatch)[ RSS](/packages/mathiasgrimm-netwatch/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Netwatch
========

[](#netwatch)

Network service latency probing tool for PHP. Measures connectivity and response times to Redis, PostgreSQL, MySQL, S3, HTTP endpoints, and raw TCP services with statistical analysis.

> **Alpha version** — This package is under active development. The API may change at any time, including breaking changes, without prior notice. Use at your own risk.

TODO
----

[](#todo)

- Include hostname/identification on the output
- Running `php artisan netwatch:run` creates file called `host=;port=;dbname=`

Maybe
-----

[](#maybe)

- Post results to some endpoint after `php artisan netwatch:run`
- Detect env/cached config. Maybe boot application once and cache it with a md5(.env)
- Maybe `Concurrency::driver(’queue’)` for async when calling `/netwatch/health`
- Store &amp; Cleanup of metrics to view on a dashboard
- Use Inertia (3) for the dashboard with polling

Features
--------

[](#features)

- **Multiple probe types** — HTTP, TCP/IP, Redis (php-redis), MySQL/PostgreSQL/SQLite (PDO), AWS S3
- **Statistical analysis** — min, max, avg, p50, p95, p99 for connect, request, and total latency
- **Parallel execution** — probes run concurrently via subprocesses (default in CLI)
- **Per-probe configuration** — individual iteration counts, enable/disable flags, serializable probe definitions
- **Laravel integration** — service provider with auto-discovery, Artisan command, and health dashboard
- **Standalone CLI** — works with any PHP project via Symfony Console
- **Fail-fast** — stops probing after 3 consecutive failures

Requirements
------------

[](#requirements)

- PHP 8.3+
- `ext-curl` (for S3 probe)
- `ext-redis` (for Redis probe, optional)
- `ext-pdo` (for database probes, optional)

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

[](#installation)

```
composer require mathiasgrimm/netwatch
```

Laravel Integration
-------------------

[](#laravel-integration)

Netwatch auto-registers via Laravel package discovery. No manual provider registration needed.

### Install

[](#install)

```
php artisan netwatch:install
```

This publishes the config file and service provider, and registers the provider in `bootstrap/providers.php`.

To overwrite previously published files:

```
php artisan netwatch:install --force
```

You can also publish assets individually:

```
php artisan vendor:publish --tag=netwatch-config
php artisan vendor:publish --tag=netwatch-provider
```

The config file (`config/netwatch.php`) contains pre-configured probes that read from your existing Laravel environment variables (`DB_*`, `REDIS_*`, `AWS_*`, `APP_URL`). The config uses the serializable `[Class::class => [args]]` array format, so it is fully compatible with `php artisan config:cache`.

```
