collector

package
v1.1.0-beta.0...-14a469a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL