mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
eedebabbea
Introduce pkg/events with filtered channels, subscription policies, backpressure, and stats. Wire AgentLoop to dual-publish legacy agent events into runtime events while preserving old event APIs. Validation: go test ./pkg/events/... ./pkg/agent; go test -race ./pkg/events/...; make lint
27 lines
482 B
Go
27 lines
482 B
Go
package events
|
|
|
|
// Stats reports aggregate EventBus counters.
|
|
type Stats struct {
|
|
Published uint64
|
|
Matched uint64
|
|
Delivered uint64
|
|
Dropped uint64
|
|
Blocked uint64
|
|
Closed bool
|
|
Subscribers int
|
|
|
|
SubscriberStats []SubscriberStats
|
|
}
|
|
|
|
// SubscriberStats reports counters for one subscription.
|
|
type SubscriberStats struct {
|
|
ID uint64
|
|
Name string
|
|
Received uint64
|
|
Handled uint64
|
|
Failed uint64
|
|
Dropped uint64
|
|
Panicked uint64
|
|
TimedOut uint64
|
|
}
|