pipe

package
v0.0.0-...-ab0a638 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: EUPL-1.2 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

Limiter is a Pipe component that limits the message rate. Note that due to packet batching this rate may be exceeded.

func NewLimiter

func NewLimiter(rate float64) *Limiter

NewLimiter creates a limiter with the given rate as the target limit.

func (*Limiter) Run

func (l *Limiter) Run(src <-chan []packet.Packet, dst chan<- []packet.Packet)

Run the pipe for the given source and destination.

type Pipe

type Pipe interface {
	// Run the pipe for the given source and destination.
	Run(src <-chan []packet.Packet, dst chan<- []packet.Packet)
}

Pipe represents a pipeline components that connects two message slice channels together. Pipes can be used to modify or analyze a message flow.

func NewStats

func NewStats(interval time.Duration) Pipe

NewStats returns a Stats Pipe that prints the statistics on the given interval (in messages).

type Stats

type Stats struct {
	// contains filtered or unexported fields
}

Stats represents a pipe component that prints the message statistics of the given flow.

func (*Stats) Print

func (s *Stats) Print(dt float64)

Print the packet rate statistics.

func (*Stats) Run

func (s *Stats) Run(src <-chan []packet.Packet, dst chan<- []packet.Packet)

Run the pipe for the given source and destination.

Jump to

Keyboard shortcuts

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