synergitech/cronitor-laravel
最新稳定版本:v1.0.0
Composer 安装命令:
composer require synergitech/cronitor-laravel
包简介
README 文档
README
Install
composer require "synergitech/cronitor-laravel"
Version compatibility
- Laravel 6.x-8.x
- PHP 7.3-7.4, 8.0
Configuration
php artisan vendor:publish --provider="SynergiTech\Cronitor\Laravel\CronitorServiceProvider"
Usage
Automatically monitoring a Job
Your Jobs can be automatically monitored by this package by implementing the HasCronitorKey contract.
use SynergiTech\Cronitor\Laravel\Contracts\HasCronitorKey; class YourJob implements HasCronitorKey { public function getMonitorKey(): string { return 'your monitor key from cronitor.io'; } }
When your Job is dispatched, a Dispatcher middleware will automatically send telemetry events based on whether your job is successful.
Monitoring arbitrary code
Additionally, you can monitor any callback via the Cronitor facade:
use SynergiTech\Cronitor\Laravel\Facades\Cronitor; class YourClass { public function handle() { Cronitor::monitorJob('your monitor key', function () { throw new \Exception('This will automatically be reported as a fail event'); }); } }
统计信息
- 总下载量: 15.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-28