Skip to content

Laravel Pulse ​

Nguồn gốc: Bản dịch từ Laravel Pulse

Giới thiệu (Introduction) ​

Laravel Pulse cung cấp application performance monitoring (APM) real-time trong một dashboard. Pulse giúp bạn theo dõi bottleneck, slow route, slow query, slow job, cache hit rate, và nhiều hơn.

Cài đặt (Installation) ​

bash
composer require laravel/pulse

Publish config và migrations:

bash
php artisan vendor:publish --provider="Laravel\Pulse\PulseServiceProvider"
php artisan migrate

Cấu hình (Configuration) ​

File config/pulse.php cấu hình recorders (thu thập dữ liệu).

Dashboard ​

Truy cập tại /pulse.

Authorization ​

Cấu hình authorization cho dashboard production.

Cards ​

Pulse cung cấp nhiều card:

  • Application Usage — User hoạt động nhiều nhất
  • Servers — CPU, RAM, disk usage
  • Slow Requests — Request chậm nhất
  • Slow Database Queries — Query chậm nhất
  • Slow Jobs — Job chậm nhất
  • Slow Outgoing Requests — HTTP request chậm nhất
  • Exceptions — Exception phổ biến nhất
  • Cache — Hit/miss rate
  • Queues — Queue throughput và wait times

Capturing Entries ​

Pulse tự động thu thập dữ liệu qua recorders. Có thể tùy chỉnh recorders hoặc tạo custom recorder.

Performance ​

Pulse được thiết kế nhẹ. Sử dụng database riêng cho Pulse nếu traffic cao.