model

package
v0.17.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	// The Update operation populates the Cluster from a cache.
	Update(cache.Cache) error

	// The GetXMetric operations extract timeseries from the Cluster.
	// The returned time.Time values signify the latest metric timestamp in the cluster.
	GetClusterMetric(ClusterRequest) ([]store.TimePoint, time.Time, error)
	GetNodeMetric(NodeRequest) ([]store.TimePoint, time.Time, error)
	GetNamespaceMetric(NamespaceRequest) ([]store.TimePoint, time.Time, error)
	GetPodMetric(PodRequest) ([]store.TimePoint, time.Time, error)
	GetPodContainerMetric(PodContainerRequest) ([]store.TimePoint, time.Time, error)
	GetFreeContainerMetric(FreeContainerRequest) ([]store.TimePoint, time.Time, error)

	// The normal Get operations extract information from the Cluster structure.
	GetAvailableMetrics() []string
	GetNodes() []string
	GetNamespaces() []string
	GetPods(string) []string
	GetPodContainers(string, string) []string
	GetFreeContainers(string) []string
}

func NewCluster

func NewCluster(tsConstructor func() store.TimeStore, resolution time.Duration) Cluster

NewCluster returns a new Cluster. Receives a TimeStore constructor function and a Duration resolution for stored data.

type ClusterInfo

type ClusterInfo struct {
	InfoType
	Namespaces map[string]*NamespaceInfo // key: Namespace Name
	Nodes      map[string]*NodeInfo      // key: Hostname
}

type ClusterRequest

type ClusterRequest struct {
	MetricName string
	Start      time.Time
	End        time.Time
}

Request Types. Used as parameters to all the Get methods of the model.

type ContainerInfo

type ContainerInfo struct {
	InfoType
}

type FreeContainerRequest

type FreeContainerRequest struct {
	NodeName      string
	ContainerName string
	MetricName    string
	Start         time.Time
	End           time.Time
}

type InfoType

type InfoType struct {
	Metrics map[string]*store.TimeStore // key: Metric Name
	Labels  map[string]string           // key: Label
	// Context retains instantaneous state for a specific InfoType.
	// Currently used for calculating instantaneous metrics from cumulative counterparts.
	Context map[string]*store.TimePoint // key: metric name
}

Internal Types

type NamespaceInfo

type NamespaceInfo struct {
	InfoType
	Pods map[string]*PodInfo // key: Pod Name
}

type NamespaceRequest

type NamespaceRequest struct {
	NamespaceName string
	MetricName    string
	Start         time.Time
	End           time.Time
}

type NodeInfo

type NodeInfo struct {
	InfoType
	Pods           map[string]*PodInfo       // key: Pod Name
	FreeContainers map[string]*ContainerInfo // key: Container Name
}

type NodeRequest

type NodeRequest struct {
	NodeName   string
	MetricName string
	Start      time.Time
	End        time.Time
}

type PodContainerRequest

type PodContainerRequest struct {
	NamespaceName string
	PodName       string
	ContainerName string
	MetricName    string
	Start         time.Time
	End           time.Time
}

type PodInfo

type PodInfo struct {
	InfoType
	UID        string
	Containers map[string]*ContainerInfo // key: Container Name
}

type PodRequest

type PodRequest struct {
	NamespaceName string
	PodName       string
	MetricName    string
	Start         time.Time
	End           time.Time
}

Jump to

Keyboard shortcuts

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