metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricTypeContainerCPUUsageTotal     MetricType = 0
	MetricTypeContainerCPUUsageTotalRate MetricType = 1
	MetricTypeContainerMemoryUsage       MetricType = 2
	MetricTypeNodeCPUUsageSecondsAvg1M   MetricType = 3
	MetricTypeNodeMemoryUsageBytes       MetricType = 4

	StringOperatorEqueal    StringOperator = 0
	StringOperatorNotEqueal StringOperator = 1

	LabelSelectorKeyNamespace     LabelSelectorKey = "namespace"
	LabelSelectorKeyPodName       LabelSelectorKey = "pod_name"
	LabelSelectorKeyContainerName LabelSelectorKey = "container_name"
	LabelSelectorKeyNodeName      LabelSelectorKey = "node_name"
)

Variables

Functions

func IsLabelNeedTransform

func IsLabelNeedTransform(src, dest string) bool

Types

type BackendQueryRequestFactory

type BackendQueryRequestFactory interface {
	BuildServiceRequest() (interface{}, error)
}

type Data

type Data struct {
	Labels  map[string]string
	Samples []Sample
}

type LabelSelector

type LabelSelector struct {
	Key, Value string
	Op         StringOperator
}

type LabelSelectorKey

type LabelSelectorKey string

type MetricType

type MetricType int

type MetricsDB

type MetricsDB interface {
	Connect() error
	Close() error
	Query(q Query) (QueryResponse, error)
}

type Query

type Query struct {
	Metric         MetricType
	TimeSelector   TimeSelector
	LabelSelectors []LabelSelector
}

type QueryResponse

type QueryResponse struct {
	Metric  MetricType
	Results []Data
}

type Sample

type Sample struct {
	Time  time.Time
	Value float64
}

type Since

type Since struct {
	Duration time.Duration
}

type StringOperator

type StringOperator int

type TimeRange

type TimeRange struct {
	StartTime, EndTime time.Time
	Step               time.Duration
}

TimeRange Represent the range of data to query. Field Step represent the time width between each sample.

type TimeSelector

type TimeSelector interface {
	// contains filtered or unexported methods
}

type Timestamp

type Timestamp struct {
	T time.Time
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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