cache

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2015 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const NodeContainerName = "machine"

NodeContainerName is the container name assigned to node level metrics.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	StorePods([]source_api.Pod) error
	StoreContainers([]source_api.Container) error
	// TODO: Handle events.
	// GetPods returns a list of pod elements in the cache between 'start' and 'end'.
	// If 'start' is zero, it returns all the elements up until 'end'.
	// If 'end' is zero, it returns all the elements from 'start'.
	// If both 'start' and 'end' are zero, it returns all the elements in the cache.
	GetPods(start, end time.Time) []*PodElement

	// GetNodes returns a list of pod elements in the cache between 'start' and 'end'.
	// If 'start' is zero, it returns all the elements up until 'end'.
	// If 'end' is zero, it returns all the elements from 'start'.
	// If both 'start' and 'end' are zero, it returns all the elements in the cache.
	GetNodes(start, end time.Time) []*ContainerElement

	// GetFreeContainers returns a list of pod elements in the cache between 'start' and 'end'.
	// If 'start' is zero, it returns all the elements up until 'end'.
	// If 'end' is zero, it returns all the elements from 'start'.
	// If both 'start' and 'end' are zero, it returns all the elements in the cache.
	GetFreeContainers(start, end time.Time) []*ContainerElement
}

func NewCache

func NewCache(bufferDuration time.Duration) Cache

type ContainerElement

type ContainerElement struct {
	Metadata
	Metrics []*ContainerMetricElement
}

type ContainerMetricElement

type ContainerMetricElement struct {
	Spec  *cadvisor_api.ContainerSpec
	Stats *cadvisor_api.ContainerStats
}

type Metadata

type Metadata struct {
	Name         string
	Namespace    string
	NamespaceUID string
	UID          string
	Hostname     string
	Labels       map[string]string
	ExternalID   string
}

type PodElement

type PodElement struct {
	Metadata
	// map of container name to container element.
	Containers []*ContainerElement
}

Jump to

Keyboard shortcuts

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