Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalCollector ¶
type GlobalCollector[T any] interface { SpawnSession() SessionCollector[T] Close() StartWorker() }
GlobalCollector provides a utility to collect stats data from each session
func NewGlobalCollector ¶
func NewGlobalCollector[T any](mergeFn func(T)) GlobalCollector[T]
NewGlobalCollector creates a new global collector
type SessionCollector ¶
type SessionCollector[T any] interface { // SendDelta sends the data to the global collector. This function will not block (unless the `timeout` reached). It // returns a bool to represent whether the data has been sent successfully. SendDelta(data T) bool // SendDeltaSync sends the data to the global collector. Unlike `SendDelta`, this function will always block and // wait until the data has been received by the global collector. SendDeltaSync(data T) bool }
SessionCollector is an interface to send stats data to the global collector
Click to show internal directories.
Click to hide internal directories.