Download the PHP package omaralalwi/laravel-jobs-metrics without Composer
On this page you can find all versions of the php package omaralalwi/laravel-jobs-metrics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download omaralalwi/laravel-jobs-metrics
More information about omaralalwi/laravel-jobs-metrics
Files in omaralalwi/laravel-jobs-metrics
Package laravel-jobs-metrics
Short Description Tracks job memory consumption โ works with or without Horizon, and enables long-term performance analysis via database logging.
License MIT
Homepage https://github.com/omaralalwi/laravel-jobs-metrics
Informations about the package laravel-jobs-metrics
Laravel Jobs Metrics
Tracks job memory consumption and execution time โ works with or without Horizon, and enables long-term performance analysis via database logging.
Table of Contents
- Installation
- Usage
- Basic Usage
- Configuration
- Viewing Job Metrics Report
- Exporting Job Metrics
- Manually Cleaning Up Old Records
- Automatic Cleanup
- Features
- Testing
- Credits
- License
- Other Packages
Installation
You can install the package via composer:
After installation, publish the configuration file (optional):
Run the migrations to create the jobs_metrics table:
Usage
Basic Usage
Add the HasJobsMetricTracker
trait to your job classes:
That's it! Metrics will be automatically recorded in the jobs_metrics
table.
Configuration
The package can be configured via the config/jobs-metrics.php
file. Here are the available options:
Viewing Job Metrics Report
The package provides a simple command to view job metrics:
The command displays a comprehensive info in CLI.
Available options:
--limit=N
: Number of jobs to display (default: 10)--sort=memory|time
: Sort by memory usage or execution time (default: memory)--days=N
: Show data from the last N days (default: 7)
Exporting Job Metrics
You can export all job metrics to a single JSON file:
The export command creates a comprehensive JSON file in the storage/app/jobs-metrics-export
directory with timestamps in the filename.
Manually Cleaning Up Old Records
You can manually clean up old metrics records using the provided artisan command:
To specify how many days of data to keep:
Automatic Cleanup
To enable automatic cleanup, ensure your Laravel scheduler is running, and add following scheduler
Features
- ๐ Records detailed metrics for each job execution (memory usage, duration)
- ๐ Works with or without Laravel Horizon
- ๐ Per-job statistics including average executions per day
- ๐ Queue-based metrics to identify bottlenecks
- ๐ Export capabilities to JSON for further analysis
- ๐งน Automatic and manual cleanup of old records
- ๐๏ธ Highly configurable with simple interface
- ๐ Simple integration with a single trait
- ๐ Tested.
Testing
Credits
- Omar Alalwi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
๐ Helpful Open Source Packages & Projects
Packages
-
Lexi Translate simplify managing translations for multilingual Eloquent models with power of morph relationships and caching .
-
Gpdf Open Source HTML to PDF converter for PHP & Laravel Applications, supports Arabic content out-of-the-box and other languages.
-
laravel Taxify Laravel Taxify provides a set of helper functions and classes to simplify tax (VAT) calculations within Laravel applications.
-
laravel Deployer Streamlined Deployment for Laravel and Node.js apps, with Zero-Downtime and various environments and branches.
-
laravel Trash Cleaner clean logs and debug files for debugging packages.
-
laravel Time Craft simple trait and helper functions that allow you, Effortlessly manage date and time queries in Laravel apps.
-
PHP builders sample php traits to add ability to use builder design patterns with easy in PHP applications.
-
PhpPy - PHP Python Interact with python in PHP applications.
-
Laravel Py - Laravel Python interact with python in Laravel applications.
-
deepseek PHP client robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities .
-
deepseek laravel Laravel wrapper for Deepseek PHP client to seamless deepseek AI API integration with Laravel applications.
-
Qwen PHP client robust and community-driven PHP client library for seamless integration with the Qwen API .
Laravel qwen wrapper for qwen PHP client to seamless Alibaba qwen AI API integration with Laravel applications..
Dashboards
-
Laravel Startkit Laravel Admin Dashboard, Admin Template with Frontend Template, for scalable Laravel projects.
Kunafa Dashboard Vue A feature-rich Vue.js 3 dashboard template with multi-language support and full RTL/LTR bidirectional layout capabilities.
References
-
Clean Code Summary summarize and notes for books and practices about clean code.
SOLID Principles Summary summarize and notes for books about SOLID Principles.
All versions of laravel-jobs-metrics with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
illuminate/console Version ^8.0|^9.0|^10.0|^11.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0