flowpipeline

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Database) GetAllRecords

func (db *Database) GetAllRecords() <-chan struct {
	key    string
	record *Record
}

func (*Database) GetRecord

func (db *Database) GetRecord(key string) *Record

type PrometheusCollector

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

func (*PrometheusCollector) Collect

func (collector *PrometheusCollector) Collect(ch chan<- prometheus.Metric)

func (*PrometheusCollector) Describe

func (collector *PrometheusCollector) Describe(ch chan<- *prometheus.Desc)

type PrometheusExporter

type PrometheusExporter struct {
	MetaReg *prometheus.Registry
	FlowReg *prometheus.Registry
	// contains filtered or unexported fields
}

Exporter provides export features to Prometheus

func (*PrometheusExporter) Initialize

func (e *PrometheusExporter) Initialize(collector *PrometheusCollector)

Initialize Prometheus Exporter

func (*PrometheusExporter) ServeEndpoints

func (e *PrometheusExporter) ServeEndpoints(segment *ToptalkersMetrics)

listen on given endpoint addr with Handler for metricPath and flowdataPath

type Record

type Record struct {
	FwdBytes    []uint64
	FwdPackets  []uint64
	DropBytes   []uint64
	DropPackets []uint64

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRecord

func NewRecord(windowSize int) *Record

func (*Record) Append

func (record *Record) Append(bytes uint64, packets uint64, statusFwd bool)

func (*Record) GetMetrics

func (record *Record) GetMetrics(buckets int, bucketDuration int) (float64, float64, float64, float64)

type ToptalkersMetrics

type ToptalkersMetrics struct {
	segments.BaseFilterSegment

	TrafficType      string // optional, default is "", name for the traffic type (included as label)
	Buckets          int    // optional, default is 60, sets the number of seconds used as a sliding window size
	ThresholdBuckets int    // optional, use the last N buckets for calculation of averages, default: $Buckets
	ReportBuckets    int    // optional, use the last N buckets to calculate averages that are reported as result, default: $Buckets
	BucketDuration   int    // optional, duration of a bucket, default is 1 second
	ThresholdBps     uint64 // optional, default is 0, only log talkers with an average bits per second rate higher than this value
	ThresholdPps     uint64 // optional, default is 0, only log talkers with an average packets per second rate higher than this value
	Endpoint         string // optional, default value is ":8080"
	MetricsPath      string // optional, default is "/metrics"
	FlowdataPath     string // optional, default is "/flowdata"
	RelevantAddress  string // optional, default is "destination", options are "destination", "source", "both"
	// contains filtered or unexported fields
}

func (ToptalkersMetrics) New

func (segment ToptalkersMetrics) New(config map[string]string) segments.Segment

func (*ToptalkersMetrics) Run

func (segment *ToptalkersMetrics) Run(wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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