Download the PHP package monkeyscloud/monkeyslegion-devtools without Composer
On this page you can find all versions of the php package monkeyscloud/monkeyslegion-devtools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monkeyscloud/monkeyslegion-devtools
More information about monkeyscloud/monkeyslegion-devtools
Files in monkeyscloud/monkeyslegion-devtools
Package monkeyslegion-devtools
Short Description Enterprise-grade debugging, profiling, inspection, and diagnostics package for MonkeysLegion β zero-magic PHP 8.4+ observability.
License MIT
Homepage https://monkeyslegion.com
Informations about the package monkeyslegion-devtools
π MonkeysLegion DevTools
Enterprise-grade debugging, profiling, and diagnostics for MonkeysLegion v2.
Inspect every request, route, query, cache operation, event, and exception β with a self-contained debug toolbar, intelligent anomaly detection, and zero runtime overhead when disabled.
β¨ Key Features
| Feature | Description |
|---|---|
| π Zero Overhead | Early-return when disabled β no reflection, no magic, no cost |
| πͺ PHP 8.4 Property Hooks | 26 computed properties replace traditional getters across the codebase |
| π N+1 Detection | Automatic duplicate query grouping with configurable thresholds |
| β‘ Cache Intelligence | Hit/miss ratios, hot key ranking, per-store breakdown |
| π‘ Event Storm Detection | Timeline visualization with storm alerts and slow listener tracking |
| π― Deterministic Sampling | Hash-based consistency for distributed trace coherence |
| π Redaction Pipeline | Recursive key-based masking β secrets never leak, even in dev |
| π‘οΈ Request Fingerprinting | xxh3-based grouping for automatic request clustering |
| π₯οΈ Debug Toolbar | Self-contained Tokyo Night UI β no external assets required |
| π§ͺ 184 Tests | 572 assertions across 22 test files β 90%+ coverage |
π¦ Installation
For production diagnostics (sampling + redacted output):
Requirements
- PHP 8.4+ (property hooks, asymmetric visibility)
- PSR-7 HTTP Message (
psr/http-message ^2.0) - PSR-15 Middleware (
psr/http-server-middleware ^1.0)
π Quick Start
1. Boot & Register Middleware
2. Record Intelligence Data
3. Inspect via CLI
4. Debug Toolbar
When toolbar.enabled is true, the toolbar auto-injects into HTML responses:
- Toggle: Click the π bar or press
Ctrl+Shift+D - 5 Panels: Overview, Queries, Cache, Events, Exceptions
- Severity Badges: Green / Yellow / Red per-panel status at a glance
- Self-Contained: Zero external CSS/JS β embedded Tokyo Night theme
The toolbar only injects into text/html responses and respects a configurable size limit.
βοΈ Configuration
Create config/devtools.mlc:
π¬ Collectors
Built-in Collectors (7)
| # | Collector | Icon | Priority | Key Features |
|---|---|---|---|---|
| 1 | Request | π | 1000 | Method, URI, headers, IP hashing, fingerprint, timing, memory |
| 2 | Middleware | π | 950 | Per-middleware timing, memory delta, bottleneck detection |
| 3 | Route | π | 900 | Pattern, controller, params, middleware stack, OpenAPI hints |
| 4 | Query | ποΈ | 800 | SQL timing, N+1 detection, duplicate grouping, source tracing |
| 5 | Cache | β‘ | 700 | Hit/miss ratio, hot key ranking, per-store breakdown |
| 6 | Event | π‘ | 600 | Timeline, storm detection, slow listeners, failed tracking |
| 7 | Exception | π₯ | 100 | Class, message, trace, chain traversal, xxh3 fingerprint |
Intelligence Features
N+1 Query Detection
The QueryCollector automatically fingerprints SQL by normalizing literals and compares execution counts against the configurable threshold.
Cache Hot Key Analysis
Event Storm Detection
Custom Collectors
Implement CollectorInterface to add your own:
π·οΈ Attributes
πͺ PHP 8.4 Property Hooks
DevTools leverages 26 PHP 8.4 property hooks β replacing traditional getters with declarative computed properties. This is a first for PHP frameworks.
Asymmetric Visibility
All mutable state uses private(set) β the profiler's internal state is read-only for external consumers:
ποΈ Storage Drivers
| Driver | Use Case | Persistence |
|---|---|---|
FileProfileStorage |
Local development β JSON files with index | β Disk |
MemoryProfileStorage |
Testing & benchmarks | β Request-scoped |
NullProfileStorage |
Disabled / CI environments | β No-op |
File storage features:
- JSON format β human-readable, diffable, grep-friendly
- Index file β fast listing without deserializing all profiles
- Retention pruning β automatic cleanup on write (no cron needed)
- Query filtering β method, URI, status, duration, environment, time range
π₯οΈ Debug Toolbar Panels
Overview Panel
Request summary, performance alerts (slow/error), and collector badge aggregation.
Query Panel
SQL listing with per-query timing, duplicate warnings (π‘), and N+1 alerts (π΄). Source file tracing for each query.
Cache Panel
Hit/miss ratio gauges, per-store breakdown table, and π₯ hot key ranking.
Event Panel
Chronological timeline with relative timestamps, storm warnings (πͺοΈ), and failed listener tracking.
Exception Panel
Error display with class highlighting, sanitized stack traces, and previous exception chain traversal.
Custom Panels
Extend AbstractPanel to add your own:
ποΈ Architecture
40 source files Β· 5,099 lines Β· 22 test files Β· 184 tests Β· 572 assertions
π Competitive Comparison
| Feature | Symfony Profiler | Laravel Telescope | ML DevTools |
|---|---|---|---|
| PHP Version | 8.2+ | 8.3+ | 8.4+ |
| Property Hooks | 0 | 0 | 26 |
| N+1 Detection | β | β | β Automatic |
| Event Storm Detection | β | β | β |
| Cache Hot Key Analysis | β | β | β |
| Deterministic Sampling | β | β | β Hash-based |
| Request Fingerprinting | β | β | β xxh3 |
| Priority Collectors | β | β | β With wrap |
| Partial Value Redaction | β | β | β |
| Self-Contained Toolbar | β Requires Webpack | β Requires Tailwind | β Embedded |
| Zero-Overhead Disabled | β οΈ Partial | β | β Full |
| Asymmetric Visibility | β | β | β private(set) |
| MLC Config Format | β | β | β Native |
π§ͺ Testing
Test Suite Coverage
| Area | Test Files | Tests | Assertions |
|---|---|---|---|
| Collectors (7) | 7 | 62 | 178 |
| Profiler Core | 3 | 28 | 102 |
| Storage (3) | 3 | 28 | 72 |
| Toolbar & Panels | 3 | 38 | 108 |
| Service Provider | 1 | 12 | 34 |
| Middleware | 1 | 4 | 12 |
| Attributes | 1 | 9 | 18 |
| Exceptions | 1 | 3 | 6 |
| Redaction | 1 | 10 | 24 |
| Sampler | 1 | 6 | 18 |
| Total | 22 | 184 | 572 |
πΊοΈ Roadmap
| Phase | Focus | Status |
|---|---|---|
| 0 | Contracts & Skeleton | β Complete |
| 1 | MVP Profiler & CLI | β Complete |
| 2 | Debug Toolbar & Local DX | β Complete |
| 3 | Query, Cache & Event Intelligence | β Complete |
| 4 | Container, Entity & Config Inspectors | π Next |
| 5 | OpenAPI, Security & Validation Reports | π Planned |
| 6 | Production Diagnostics & APM | π Planned |
| 7 | MonkeysCloud SaaS Integration | π Planned |
π€ Contributing
- Fork & clone the repository
- Install dependencies:
composer install - Run the test suite:
composer test - Run static analysis:
composer analyse - Submit a PR against
main
Please ensure all new collectors include corresponding unit tests and property hooks where applicable.
π License
MIT β Β© 2026 MonkeysCloud Team
Built with π by MonkeysCloud
All versions of monkeyslegion-devtools with dependencies
psr/http-message Version ^2.0
psr/http-server-middleware Version ^1.0
psr/http-server-handler Version ^1.0
psr/log Version ^3.0
monkeyscloud/monkeyslegion-cli Version ^2.0
monkeyscloud/monkeyslegion-mlc Version ^3.2