Weave Code
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 Package

leventcz/laravel-top

Real-time, lightweight monitoring for Laravel from the CLI. Listens to request events, aggregates short-lived metrics in Redis, and displays 5-second averages across all app servers. Ideal for production to spot load, latency, and busiest routes.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit:

  • Strengths: Tightly integrated with Laravel’s event system, leveraging Redis for lightweight, real-time aggregation. Aligns with Laravel 13.x’s focus on performance and CLI-driven workflows. The short-TTL Redis storage prevents data bloat, making it ideal for transient production diagnostics.
  • Weaknesses: Excludes queue/command metrics, limiting visibility to HTTP-only traffic. Redis dependency adds operational complexity if not already in use. No support for distributed tracing or long-term trend analysis, restricting use cases to immediate troubleshooting.
  • Laravel 13.x Fit: Explicit compatibility confirmed, but no architectural changes address Octane-specific event handling or Valet/Forge edge cases. The package remains a "best effort" solution for HTTP-centric monitoring.

Integration feasibility:

  • Pros: Zero database migrations, minimal config (vendor:publish), and no external services required. Composer install + Redis setup is the only prerequisite.
  • Cons: Undocumented behavior for recording_mode=always in non-HTTP contexts (e.g., CLI commands). No validation for Redis connection health during runtime. Laravel 13.x compatibility is confirmed but untested in Octane or multi-server environments.
  • Risk: High for teams relying on Redis for other critical functions (e.g., caching, queues). The package’s lack of error handling for Redis failures could crash the application during outages.

Technical risk:

  • Scalability: Unchanged aggregation logic (5-second windows) may not scale beyond 10k RPS without Redis tuning. No benchmarks provided for Laravel 13.x/Octane.
  • Stability: Low adoption (0 dependents) and no commercial support. The 2025 release date in metadata suggests potential versioning instability.
  • Gaps: No documentation on handling Redis failures, memory leaks, or Laravel 13.x-specific edge cases (e.g., Octane event propagation).

Key questions:

  1. Performance: How does Redis write volume scale at >5k RPS in Laravel 13.x/Octane? Are there known bottlenecks?
  2. Reliability: What failure modes occur during Redis downtime? Does the package degrade gracefully or crash?
  3. Compatibility: Has recording_mode=always been tested in non-HTTP contexts (e.g., CLI commands, queues) in Laravel 13.x?
  4. Memory: Are there known memory leaks in the event listener for Laravel 13.x?
  5. Testing: What Laravel 13.x environments were tested (e.g., Octane, Valet, Forge)? Were there failures in any?

Integration Approach

Stack fit:

  • Ideal for: Laravel 10–13.x applications with Redis 5.0+ and PHP 8.2+. Explicitly supports Octane, making it a strong fit for modern Laravel deployments.
  • Anti-patterns: Avoid if Redis is not already in use (adds dependency) or if queue/command metrics are critical.
  • Dependencies: Requires predis/predis or phpredis extension (standard in Laravel stacks).

Migration path:

  1. Pre-install: Verify Redis 5.0+ and PHP 8.2+ compatibility.
  2. Install: composer require leventcz/laravel-top:^1.3.0.
  3. Configure: Publish config (php artisan vendor:publish --tag="top") if using non-default Redis.
  4. Test: Run php artisan top in staging to validate metrics collection.
  5. Deploy: Monitor Redis memory usage and application stability post-launch.

Compatibility:

  • Confirmed: Laravel 10–13.x, Octane, Redis 5.0+.
  • Unsupported: Queue/command metrics, non-HTTP contexts (unless recording_mode=always is tested).
  • Edge Cases: Laravel 13.x’s Octane event system may require additional testing for accurate metrics.

Sequencing:

  1. Phase 1: Install and validate basic metrics (php artisan top) in a non-production environment.
  2. Phase 2: Integrate facade into custom CLI tools or admin dashboards (e.g., Top::routes() for route performance).
  3. Phase 3: Monitor Redis memory usage and application logs for errors during peak traffic.
  4. Phase 4: (Optional) Extend for custom metrics by hooking into Laravel events (e.g., Top::startRecording() during deployments).

Operational Impact

Maintenance:

  • Effort: Low for basic usage but high for customization due to lack of documentation and community support.
  • Risks: No commercial support or SLAs. Teams must monitor GitHub issues for fixes (e.g., Redis failure handling).
  • Mitigation: Fork the repository to address critical gaps (e.g., error handling) if adoption is critical.

Support:

  • Channels: Solely GitHub issues. No dedicated support or documentation for Laravel 13.x-specific problems.
  • Workarounds: Teams may need to build internal runbooks for troubleshooting (e.g., Redis downtime, Octane compatibility).
  • Escalation: No clear path for urgent issues; reliance on community response times.

Scaling:

  • Performance: Designed for lightweight use (5-second aggregation windows). May require Redis tuning (e.g., maxmemory-policy) at >10k RPS.
  • Multi-server: Shared Redis instance required for accurate cross-server metrics. No built-in support for Redis clustering.
  • Monitoring: Track redis_memory_used and redis_commands_processed to avoid bottlenecks.

Failure modes:

  1. Redis Downtime: Metrics collection halts; no fallback mechanism (unchanged from prior versions).
  2. Stale Metrics: Idle periods show 0 values due to TTL cleanup (expected behavior).
  3. Configuration Errors: Silent failures if Redis connection is misconfigured (e.g., wrong host/port).
  4. Laravel 13.x Edge Cases: Untested behavior in Octane or Valet/Forge environments (e.g., event propagation delays).
  5. Memory Leaks: Potential in event listeners if not properly cleaned up (no documentation or tests for Laravel 13.x).

Ramp-up:

  • Learning Curve: Minimal for basic usage (php artisan top). Facade methods follow Laravel patterns.
  • Time to Value: <5 minutes for initial metrics collection. Custom integrations (e.g., dashboards) require additional development.
  • Documentation Gaps: Lacks advanced troubleshooting for Laravel 13.x (e.g., Octane, Redis failures). Teams may need to reverse-engineer event listeners.
  • Training: Focus on Redis monitoring and Laravel event system basics for effective use.
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai