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)
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"
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" />
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.