geowrgetudor / disk-metrics
Monitor disk size, file & directory count for Laravel Pulse
Installs: 37 482
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ^8.1|^8.2|^8.3
- illuminate/contracts: ^10.0|^11.0
- laravel/pulse: ^1.0@beta
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8|^8.0
- orchestra/testbench: ^8.8|^9.0
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
README
Disk Metrics for Laravel Pulse
Credits to Aaron Francis for his Pulse tutorial.
This is a Laravel Pulse package that adds metrics for your Local and S3 storage.
- Total Size
- Total Files
- Total Directories (only for
local
driver)
Installation
You can install the package via composer:
composer require geowrgetudor/disk-metrics
You can publish the config file with:
php artisan vendor:publish --tag="disk-metrics-config"
This is the contents of the published config file:
return [ /** * Track disks defined in filesystems.php config file. * Support only 'local' or 's3' driver. * * You can pass an array ['directories', 'files'] ONLY to a local disk * which will determine what to be counted. To count both, * you can pass an empty array. */ 'disks' => [ 'local' => [], // 'public' => [], // 's3' => [] ], /** * How often (in minutes) should the Laravel Pulse capture data? * The value should be greated than 1! * Default: 10 */ 'record_interval' => 10 ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="disk-metrics-views"
Usage
Register the recorder inside config/pulse.php
. (If you don't have this file make sure you have published the config file of Larave Pulse using php artisan vendor:publish --tag=pulse-config
)
return [
// ...
'recorders' => [
// Existing recorders...
\Geow\DiskMetrics\Recorders\DiskRecorder::class => [
'enabled' => env('GEOW_DISK_METRICS', true),
]
]
]
Publish Laravel Pulse dashboard.blade.php
view using php artisan vendor:publish --tag=pulse-dashboard
Then you can modify the file and add the disk-metrics livewire template.
<livewire:disk-metrics cols="4" rows="2" />
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.