model

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchPodRequest added in v0.18.1

type BatchPodRequest struct {
	NamespaceName string
	PodNames      []string
	MetricName    string
	Start         time.Time
	End           time.Time
}

type ClusterInfo

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

type ClusterMetricRequest added in v0.18.1

type ClusterMetricRequest struct {
	MetricRequest
}

Metric Request Types

type ContainerInfo

type ContainerInfo struct {
	InfoType
}

type EntityListEntry added in v0.18.1

type EntityListEntry struct {
	Name     string
	CPUUsage uint64
	MemUsage uint64
}

Listing Types

type FreeContainerMetricRequest added in v0.18.1

type FreeContainerMetricRequest struct {
	NodeName      string
	ContainerName string
	MetricRequest
}

type FreeContainerRequest

type FreeContainerRequest struct {
	NodeName      string
	ContainerName string
}

type InfoType

type InfoType struct {
	Creation time.Time
	Metrics  map[string]*daystore.DayStore // 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]*statstore.TimePoint // key: metric name
}

Internal Types

type MetricRequest added in v0.18.1

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

Simple Request Types.

type Model added in v0.18.1

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

	// The simple Get operations extract structural information from the Model.
	GetAvailableMetrics() []string
	GetNodes() []EntityListEntry
	GetNamespaces() []EntityListEntry
	GetPods(string) []EntityListEntry
	GetPodContainers(string, string) []EntityListEntry
	GetNodePods(string) []EntityListEntry
	GetFreeContainers(string) []EntityListEntry

	// The GetXMetric operations extract timeseries from the Model.
	// The returned time.Time values signify the latest metric timestamp in the cluster.
	GetClusterMetric(ClusterMetricRequest) ([]statstore.TimePoint, time.Time, error)
	GetNodeMetric(NodeMetricRequest) ([]statstore.TimePoint, time.Time, error)
	GetNamespaceMetric(NamespaceMetricRequest) ([]statstore.TimePoint, time.Time, error)
	GetPodMetric(PodMetricRequest) ([]statstore.TimePoint, time.Time, error)
	GetBatchPodMetric(req BatchPodRequest) ([][]statstore.TimePoint, time.Time, error)
	GetPodContainerMetric(PodContainerMetricRequest) ([]statstore.TimePoint, time.Time, error)
	GetFreeContainerMetric(FreeContainerMetricRequest) ([]statstore.TimePoint, time.Time, error)

	// The GetXStats operations extract all derived stats for a single entity of the cluster.
	GetClusterStats() (map[string]StatBundle, time.Duration, error)
	GetNodeStats(NodeRequest) (map[string]StatBundle, time.Duration, error)
	GetNamespaceStats(NamespaceRequest) (map[string]StatBundle, time.Duration, error)
	GetPodStats(PodRequest) (map[string]StatBundle, time.Duration, error)
	GetPodContainerStats(PodContainerRequest) (map[string]StatBundle, time.Duration, error)
	GetFreeContainerStats(FreeContainerRequest) (map[string]StatBundle, time.Duration, error)
}

func NewModel added in v0.18.1

func NewModel(resolution time.Duration) Model

NewModel returns a new Model. Receives a DayStore constructor function and a Duration resolution for stored data.

type NamespaceInfo

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

type NamespaceMetricRequest added in v0.18.1

type NamespaceMetricRequest struct {
	NamespaceName string
	MetricRequest
}

type NamespaceRequest

type NamespaceRequest struct {
	NamespaceName string
}

type NodeInfo

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

type NodeMetricRequest added in v0.18.1

type NodeMetricRequest struct {
	NodeName string
	MetricRequest
}

type NodeRequest

type NodeRequest struct {
	NodeName string
}

type PodContainerMetricRequest added in v0.18.1

type PodContainerMetricRequest struct {
	NamespaceName string
	PodName       string
	ContainerName string
	MetricRequest
}

type PodContainerRequest

type PodContainerRequest struct {
	NamespaceName string
	PodName       string
	ContainerName string
}

type PodInfo

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

type PodMetricRequest added in v0.18.1

type PodMetricRequest struct {
	NamespaceName string
	PodName       string
	MetricRequest
}

type PodRequest

type PodRequest struct {
	NamespaceName string
	PodName       string
}

type StatBundle added in v0.18.1

type StatBundle struct {
	Minute Stats
	Hour   Stats
	Day    Stats
}

type Stats added in v0.18.1

type Stats struct {
	Average     uint64
	NinetyFifth uint64
	Max         uint64
}

Jump to

Keyboard shortcuts

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