Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStorage ¶
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 }
Click to show internal directories.
Click to hide internal directories.