Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Top

Laravel Top Laravel Package

leventcz/laravel-top

Lightweight real-time monitoring for Laravel apps directly from the command line. Run php artisan top to track essential metrics and busiest routes in production, with aggregated Redis data across all servers.

View on GitHub
Deep Wiki
Context7

Laravel Top is a lightweight, command-line monitoring tool for Laravel applications, built for production use. Running php artisan top gives you real-time visibility into essential metrics and helps you identify your busiest routes without any external dashboard.

It works by listening to Laravel's incoming request events and aggregating data in Redis with a short TTL, so historical data is never retained and Redis stays lean. Metrics are averaged over the last 5 seconds, and because storage is shared, output reflects all application servers, not just the one running the command. Fully compatible with Laravel 10+, Laravel Octane, and requiring PHP 8.2+ and Redis 5.0+.

  • Real-time CLI monitoring with zero dashboards
  • Aggregated metrics stored in Redis with short TTL
  • Identifies busiest routes instantly
  • Cross-server insight from shared Redis data
  • Supports Laravel Octane and queue-free request tracking
Frequently asked questions about Laravel Top
How do I install and set up leventcz/laravel-top for Laravel 13.x/Octane?
Run `composer require leventcz/laravel-top` to install. Publish the config with `php artisan vendor:publish --tag=top` and ensure your `config/database.php` has a valid Redis connection. The package requires PHP 8.2+ and Redis 5.0+, and is officially compatible with Laravel 10+ and Octane.
Does leventcz/laravel-top support Laravel Octane’s event loop and async workers?
The package is compatible with Octane but lacks explicit testing for its event loop or async workers. It assumes traditional request lifecycles, so behavior in high-concurrency Octane environments may vary. Test under load to validate metrics accuracy for async contexts.
What metrics does leventcz/laravel-top track, and are queues/commands included?
The package monitors HTTP request metrics like busiest routes, response times, and server-wide performance. It does **not** track queues, CLI commands, or background jobs—only events from incoming requests. For non-HTTP workloads, consider alternatives like Laravel Horizon or Sentry.
How does Redis storage work, and what’s the TTL for aggregated data?
Metrics are stored in Redis with a **short TTL (5-second aggregation window)** to avoid historical bloat. Data is auto-cleaned, but high request volumes (>5k RPS) may require Redis tuning (e.g., pipelining, `maxmemory-policy`). The package assumes Redis is available; downtime handling is undocumented.
Can I use leventcz/laravel-top in a multi-server Laravel deployment?
Yes, the package aggregates data across all servers via Redis. However, it assumes a single Redis instance and lacks distributed tracing. For multi-server setups, ensure Redis is properly configured for high throughput and test for contention under load.
What happens if Redis fails while leventcz/laravel-top is running?
The package has **no documented fallback** for Redis failures. If Redis is unavailable, it may crash or silently degrade. For production, implement Redis resilience (e.g., retries, circuit breakers) or use a secondary Redis instance for monitoring.
Is leventcz/laravel-top safe for production, and are there memory leaks?
The package is designed for production but lacks benchmarks for Laravel 13.x/Octane. No memory leaks are documented, but the event listener’s behavior in long-running requests or Octane’s concurrent workers is untested. Monitor Redis memory usage and test under load.
How do I customize or extend leventcz/laravel-top’s metrics?
Use the facade API (`Top::http()`, `Top::routes()`) to programmatically access metrics. Publish the config to adjust Redis settings or event listeners. For custom metrics, extend the event listener or integrate with Laravel’s `events` system, but note the package only tracks HTTP events.
Are there alternatives to leventcz/laravel-top for Laravel monitoring?
For HTTP metrics, consider **Laravel Debugbar**, **Telescope**, or **Sentry**. For queues/commands, use **Horizon** or **Laravel Scout**. For distributed tracing, **OpenTelemetry** or **Datadog** are better suited. Unlike this package, alternatives often support long-term storage and non-HTTP workloads.
How do I test leventcz/laravel-top in CI/CD or staging environments?
Run `php artisan top` manually or automate it in CI with `php artisan top --no-interaction`. Mock Redis in tests using Laravel’s `RedisFake` or a local Redis instance. Validate metrics against known traffic patterns, but note the package’s limited testing for Laravel 13.x/Octane edge cases.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections