定制 webpatser/resonate-pulse 二次开发

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

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

webpatser/resonate-pulse

Composer 安装命令:

composer require webpatser/resonate-pulse

包简介

Laravel Pulse cards for the webpatser/resonate plugin family

README 文档

README

Laravel Pulse cards for the Resonate plugin family. Four cards covering the cluster roster, webhook delivery, per-user-cap terminations, and token-auth rejections, each driven by a Pulse recorder that ingests on a beat or on an event.

Cards

Card Source plugin (required to enable) Recorder Pulse series
Roster webpatser/resonate-roster 0.2+ Pulse\RosterRecorder (beat) resonate_roster_rooms, resonate_roster_users, resonate_roster_connections
Webhooks webpatser/resonate-webhooks 0.2+ Pulse\WebhooksRecorder (events) resonate_webhook_delivered, resonate_webhook_failed
UserCap webpatser/resonate-user-cap 0.2+ Pulse\UserCapRecorder (event) resonate_user_cap_exceeded
TokenAuth webpatser/resonate-token-auth 0.2+ Pulse\TokenAuthRecorder (event) resonate_token_rejected

A recorder is only useful when its source plugin is installed. The pulse package does not hard-require the three event-driven plugins; the host opts in to each recorder via config/pulse.php, and you only register the cards you have data for.

Requirements

  • PHP 8.5+
  • Laravel 13
  • laravel/pulse 1.7+
  • webpatser/resonate-roster 0.2+ (the Roster card and recorder always require this)

Installation

composer require webpatser/resonate-pulse

Publish the config if you want to change the Roster sampling interval:

php artisan vendor:publish --tag=resonate-pulse-config

Registering recorders

Add only the recorders for the plugins you have installed to config/pulse.php:

'recorders' => [
    // ... your other recorders

    \Webpatser\ResonatePulse\Pulse\RosterRecorder::class => [],     // requires resonate-roster
    \Webpatser\ResonatePulse\Pulse\WebhooksRecorder::class => [],   // requires resonate-webhooks
    \Webpatser\ResonatePulse\Pulse\UserCapRecorder::class => [],    // requires resonate-user-cap
    \Webpatser\ResonatePulse\Pulse\TokenAuthRecorder::class => [],  // requires resonate-token-auth
],

Pulse takes care of subscribing each recorder to its $listen event (or, for RosterRecorder, the per-second IsolatedBeat). Your existing pulse:check schedule keeps running them.

Adding cards to the dashboard

Publish the Pulse dashboard if you haven't yet:

php artisan vendor:publish --tag=pulse-dashboard

Drop the cards you want into resources/views/vendor/pulse/dashboard.blade.php:

<x-pulse>
    <livewire:resonate-pulse.roster cols="6" rows="2" />
    <livewire:resonate-pulse.webhooks cols="6" rows="2" />
    <livewire:resonate-pulse.user-cap cols="6" rows="2" />
    <livewire:resonate-pulse.token-auth cols="6" rows="2" />
    {{-- ...your other cards --}}
</x-pulse>

Configuration

Key Default Purpose
interval 15 Roster sampling interval in seconds. The other recorders are event-driven and ignore this.

How the recorders write

  • Roster is a beat recorder: each IsolatedBeat (one per second) is gated by the interval, and on each tick it snapshots RoomRoster::occupiedChannels() and writes three series with avg + max aggregates.
  • Webhooks / UserCap / TokenAuth are event recorders: each Laravel event becomes one Pulse record with count as the aggregate. Buckets are by application id (Webhooks, UserCap) or rejection reason (TokenAuth), so the cards can break the total down.

License

MIT. See LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固