collector

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentTimeGetter added in v0.3.0

func CurrentTimeGetter() func() time.Time

Types

type Collector

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

func New

func New(
	cfg Config,
	log logrus.FieldLogger,
	kubeWatcher kube.Watcher,
	conntracker conntrack.Client,
	currentTimeGetter func() time.Time,
) *Collector

func (*Collector) GetMetricsChan

func (a *Collector) GetMetricsChan() <-chan PodNetworkMetric

func (*Collector) Start

func (a *Collector) Start(ctx context.Context) error

type Config

type Config struct {
	Interval          time.Duration
	NodeName          string
	ExcludeNamespaces string
	CacheItems        int
}

type PodNetworkMetric

type PodNetworkMetric struct {
	SrcIP        string `json:"src_ip"`
	SrcPod       string `json:"src_pod"`
	SrcNamespace string `json:"src_namespace"`
	SrcNode      string `json:"src_node"`
	SrcZone      string `json:"src_zone"`
	DstIP        string `json:"dst_ip"`
	DstIPType    string `json:"dst_ip_type"`
	DstPod       string `json:"dst_pod"`
	DstNamespace string `json:"dst_namespace"`
	DstNode      string `json:"dst_node"`
	DstZone      string `json:"dst_zone"`
	TxBytes      uint64 `json:"tx_bytes"`
	TxPackets    uint64 `json:"tx_packets"`
	RxBytes      uint64 `json:"rx_bytes"`
	RxPackets    uint64 `json:"rx_packets"`
	Proto        string `json:"proto"`
	TS           uint64 `json:"ts"`
}

Jump to

Keyboard shortcuts

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