kodamity/laravel-api-usage-pulse
Composer 安装命令:
composer require kodamity/laravel-api-usage-pulse
包简介
API usage cards for Laravel Pulse
README 文档
README
API usage cards for Laravel Pulse
This is package that adds API usage cards and recorders for Laravel Pulse.
Installation
You can install the package via composer:
composer require kodamity/laravel-api-usage-pulse
Recorders
Add recorders configuration inside config/pulse.php. (If you don't have this file make sure you have published the config file of Laravel Pulse using php artisan vendor:publish --tag=pulse-config)
Requests Statistics recorder
Requests Statistics recorder records the number of requests and the number of successful requests in general for all users. And it records the number of requests and the number of successful requests for each user.
return [ // ... 'recorders' => [ // Existing recorders... \Kodamity\Libraries\ApiUsagePulse\Recorders\RequestsStatistics::class => [ 'enabled' => env('PULSE_KDM_API_USAGE_REQUESTS_STATISTICS_ENABLED', true), 'sample_rate' => env('PULSE_KDM_API_USAGE_REQUESTS_STATISTICS_SAMPLE_RATE', 1), 'ignore' => [ '#^/pulse$#', // Pulse dashboard... ], ], ], ];
Responses Statistics recorder
Responses Statistics recorder records the average response time and the number of responses by status code group for all users.
return [ // ... 'recorders' => [ // Existing recorders... \Kodamity\Libraries\ApiUsagePulse\Recorders\ResponsesStatistics::class => [ 'enabled' => env('PULSE_KDM_API_USAGE_RESPONSES_STATISTICS_ENABLED', true), 'sample_rate' => env('PULSE_KDM_API_USAGE_RESPONSES_STATISTICS_SAMPLE_RATE', 1), 'ignore' => [ '#^/pulse$#', // Pulse dashboard... ], 'records' => [ \Kodamity\Libraries\ApiUsagePulse\Enums\ResponseStatusGroup::Informational->value, \Kodamity\Libraries\ApiUsagePulse\Enums\ResponseStatusGroup::Successful->value, \Kodamity\Libraries\ApiUsagePulse\Enums\ResponseStatusGroup::Redirection->value, \Kodamity\Libraries\ApiUsagePulse\Enums\ResponseStatusGroup::ClientError->value, \Kodamity\Libraries\ApiUsagePulse\Enums\ResponseStatusGroup::ServerError->value, ], ], ], ];
Dashboards
To add the card to the Pulse dashboard, you must first publish the vendor view.
php artisan vendor:publish --tag=pulse-dashboard
Then, you can modify the dashboard.blade.php file and add the card to the dashboard.
<livewire:kodamity.pulse.api-usage.requests-summary cols="5" rows="2" /> <livewire:kodamity.pulse.api-usage.response-statuses-graph cols="7" /> <livewire:kodamity.pulse.api-usage.response-times-graph cols="7" />
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.
kodamity/laravel-api-usage-pulse 适用场景与选型建议
kodamity/laravel-api-usage-pulse 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 574 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 02 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「laravel」 「pulse」 「laravel-pulse」 「Kodamity」 「laravel-api-usage-pulse」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kodamity/laravel-api-usage-pulse 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kodamity/laravel-api-usage-pulse 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kodamity/laravel-api-usage-pulse 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Monitor disk size, file & directory count for Laravel Pulse
Monitor 404 pages within Laravel Pulse
A Laravel Pulse card to track users & URL's that are being throttled by your Rate Limiters
A PSR-7 compatible library for making CRUD API endpoints
Monitor 404 pages within Laravel Pulse
Alfabank REST API integration
统计信息
- 总下载量: 574
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-18
