定制 idfx/laravel-disk-monitor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

idfx/laravel-disk-monitor

最新稳定版本:0.0.3

Composer 安装命令:

composer require idfx/laravel-disk-monitor

包简介

Monitor metrics of Laravel disk

README 文档

README

Latest Version on Packagist Total Downloads run-tests fix-php-code-style-issues

Monitors the metrics of disks used by Laravel - Spatie package training.

Installation

You can install the package via composer:

composer require idfx/laravel-disk-monitor

You can publish and run the migrations with:

php artisan vendor:publish --tag="disk-monitor-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="disk-monitor-config"

This is the contents of the published config file:

return [
    /**
     * Name of the disk you want to monitor.
     */
    'disk_names' => [
        'local',
    ],
];

Finally, you should schedule the Spatie\DiskMonitor\Commands\RecordsDiskMetricsCommand to run daily.

// in app/Console/Kernel.php

use \Spatie\DiskMonitor\Commands\RecordsDiskMetricsCommand;

class Kernel extends ConsoleKernel
{
    protected function schedule(Schedule $schedule)
    {
       // ...
        $schedule->command(RecordsDiskMetricsCommand::class)->daily();
    }
}

Optionally, you can publish the views using

php artisan vendor:publish --tag="disk-monitor-views"

Usage

You can view the amount of files each monitored disk has, in the disk_monitor_entries table.

If you want to view the statistics in the browser add this macro to your routes file.

// in a routes files

Route::diskMonitor('my-disk-monitor-url');

Now, you can see all statics when browsing /my-disk-monitor-url. Of course, you can use any url you want when using the diskMonitor route macro. We highly recommand using the auth middleware for this route, so guests can't see any data regarding your disks.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

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.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-12