flow

package
v1.8.0-crc0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounter

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

Accounter accumulates flows metrics in memory and eventually evicts them via an evictor channel. The accounting process is usually done at kernel-space. This type reimplements it at userspace for the edge case where packets are submitted directly via ring-buffer because the kernel-side accounting map is full.

func NewAccounter

func NewAccounter(
	maxEntries int, evictTimeout time.Duration,
	clock func() time.Time,
	monoClock func() time.Duration,
	m *metrics.Metrics,
	s *ovnobserv.SampleDecoder,
	udnEnabled bool,
) *Accounter

NewAccounter creates a new Accounter. The cache has no limit and it's assumed that eviction is done by the caller.

func (*Accounter) Account

func (c *Accounter) Account(in <-chan *model.RawRecord, out chan<- []*model.Record)

Account runs in a new goroutine. It reads all the records from the input channel and accumulate their metrics internally. Once the metrics have reached their max size or the eviction times out, it evicts all the accumulated flows by the returned channel.

type CapacityLimiter added in v0.2.1

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

CapacityLimiter forwards the flows between two nodes but checks the status of the destination node's buffered channel. If it is already full, it drops the incoming flow and periodically will log a message about the number of lost flows.

func NewCapacityLimiter

func NewCapacityLimiter(m *metrics.Metrics) *CapacityLimiter

func (*CapacityLimiter) Limit added in v0.2.1

func (c *CapacityLimiter) Limit(in <-chan []*model.Record, out chan<- []*model.Record)

type MapTracer added in v0.2.1

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

MapTracer accesses a mapped source of flows (the eBPF PerCPU HashMap), deserializes it into a flow model.Record structure, and performs the accumulation of each perCPU-record into a single flow

func NewMapTracer added in v0.2.1

func NewMapTracer(fetcher mapFetcher, evictionTimeout, staleEntriesEvictTimeout time.Duration, m *metrics.Metrics,
	s *ovnobserv.SampleDecoder, udnEnabled bool) *MapTracer

func (*MapTracer) Flush added in v0.2.1

func (m *MapTracer) Flush()

Flush forces reading (and removing) all the flows from the source eBPF map and sending the entries to the next stage in the pipeline

func (*MapTracer) TraceLoop added in v0.2.1

func (m *MapTracer) TraceLoop(ctx context.Context, forceGC bool) node.StartFunc[[]*model.Record]

type PerfBuffer added in v0.3.3

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

func NewPerfBuffer added in v0.3.3

func NewPerfBuffer(
	maxEntries int, evictTimeout time.Duration,
) *PerfBuffer

func (*PerfBuffer) PBuffer added in v0.3.3

func (c *PerfBuffer) PBuffer(in <-chan *model.PacketRecord, out chan<- []*model.PacketRecord)

type PerfTracer added in v0.3.3

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

RingBufTracer receives single-packet flows via ringbuffer (usually, these that couldn't be added in the eBPF kernel space due to the map being full or busy) and submits them to the userspace Aggregator map

func NewPerfTracer added in v0.3.3

func NewPerfTracer(
	reader perfReader, logTimeout time.Duration,
) *PerfTracer

func (*PerfTracer) TraceLoop added in v0.3.3

type RingBufTracer added in v0.2.1

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

RingBufTracer receives single-packet flows via ringbuffer (usually, these that couldn't be added in the eBPF kernel space due to the map being full or busy) and submits them to the userspace Aggregator map

func NewRingBufTracer added in v0.2.1

func NewRingBufTracer(reader ringBufReader, flusher mapFlusher, logTimeout time.Duration, m *metrics.Metrics) *RingBufTracer

func (*RingBufTracer) TraceLoop added in v0.2.1

Jump to

Keyboard shortcuts

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