metrics_handlers

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerMetrics

type ContainerMetrics struct {
	Name      string
	Namespace string
	Cpu       Metric
	Memory    Metric
}

type Default

type Default struct{}

func (*Default) Handle

func (d *Default) Handle(metrics <-chan MetricBatch)

func (*Default) Init

func (d *Default) Init(c *config.Config) error

type Metric

type Metric struct {
	Value     uint64
	Timestamp time.Time
}

type MetricBatch

type MetricBatch struct {
	Nodes map[string]NodeMetrics
	Pods  map[string]PodMetrics
}

type MetricsHandler

type MetricsHandler interface {
	Init(c *config.Config) error
	Handle(metrics <-chan MetricBatch)
}

type Metricstream

type Metricstream struct {
	Finished bool
	// contains filtered or unexported fields
}

func NewMetricStream

func NewMetricStream(pod *api_v1.Pod, handler MetricsHandler) *Metricstream

func (*Metricstream) Delete

func (m *Metricstream) Delete()

func (*Metricstream) Finish

func (m *Metricstream) Finish()

func (*Metricstream) Start

func (m *Metricstream) Start(r *rest.Config, ch chan<- MetricBatch)

type NetworkLabel

type NetworkLabel struct {
	Container   string `json:"container"`
	ID          string `json:"id"`
	Image       string `json:"image"`
	Interface   string `json:"interface"`
	ContainerID string `json:"name"`
	Namespace   string `json:"namespace"`
	Pod         string `json:"pod"`
}

type NodeMetrics

type NodeMetrics struct {
	Name   string
	Cpu    Metric
	Memory Metric
}

type PodMetrics

type PodMetrics struct {
	Name           string
	Namespace      string
	Cpu            Metric
	Memory         Metric
	RXBytesTotal   Metric
	RXErrTotal     Metric
	RXPktDropTotal Metric
	RXPktTotal     Metric
	TXBytesTotal   Metric
	TXErrTotal     Metric
	TXPktDropTotal Metric
	TXPktTotal     Metric
	Containers     map[string]ContainerMetrics
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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