storage

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorage

func NewStorage(metricResolution time.Duration) *storage

func RegisterStorageMetrics

func RegisterStorageMetrics(registrationFunc func(metrics.Registerable) error) error

RegisterStorageMetrics registers a gauge metric for the number of metrics points stored.

Types

type MetricsBatch

type MetricsBatch struct {
	Nodes map[string]MetricsPoint
	Pods  map[apitypes.NamespacedName]PodMetricsPoint
}

MetricsBatch is a single batch of pod, container, and node metrics from some source.

type MetricsPoint

type MetricsPoint struct {
	// StartTime is the start time of container/node. Cumulative CPU usage at that moment should be equal zero.
	StartTime time.Time
	// Timestamp is the time when metric point was measured. If CPU and Memory was measured at different time it should equal CPU time to allow accurate CPU calculation.
	Timestamp time.Time
	// CumulativeCpuUsed is the cumulative cpu used at Timestamp from the StartTime of container/node. Unit: nano core * seconds.
	CumulativeCpuUsed uint64
	// MemoryUsage is the working set size. Unit: bytes.
	MemoryUsage uint64
}

MetricsPoint represents the a set of specific metrics at some point in time.

type PodMetricsPoint

type PodMetricsPoint struct {
	Containers map[string]MetricsPoint
}

PodMetricsPoint contains the metrics for some pod's containers.

type Storage

type Storage interface {
	api.MetricsGetter
	Store(batch *MetricsBatch)
	Ready() bool
}

Jump to

Keyboard shortcuts

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