container

package
v4.2.457+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Time        Tag = "time"
	Namespace   Tag = "namespace"
	PodName     Tag = "pod_name"
	Name        Tag = "name"
	Metric      Tag = "metric"
	Granularity Tag = "granularity"
	Kind        Tag = "kind"

	ModelId      Field = "model_id"
	PredictionId Field = "prediction_id"
	Value        Field = "value"
)

Variables

View Source
var (
	// Tags Tags' name in influxdb
	Tags = []Tag{Namespace, PodName, Name, Metric, Granularity, Kind}
	// Fields Fields' name in influxdb
	Fields = []Field{ModelId, PredictionId, Value}
	// MetricTypeCPUUsage Enum of tag "metric"
	MetricTypeCPUUsage MetricType = "cpu_usage_seconds_percentage"
	// MetricTypeMemoryUsage Enum of tag "metric"
	MetricTypeMemoryUsage MetricType = "memory_usage_bytes"

	// LocalMetricTypeToPkgMetricType Convert local package metric type to package alameda.datahub.metric.NodeMetricType
	LocalMetricTypeToPkgMetricType = map[MetricType]metric.NodeMetricType{
		MetricTypeCPUUsage:    metric.TypeContainerCPUUsageSecondsPercentage,
		MetricTypeMemoryUsage: metric.TypeContainerMemoryUsageBytes,
	}

	// PkgMetricTypeToLocalMetricType Convert package alameda.datahub.metric.NodeMetricType to local package metric type
	PkgMetricTypeToLocalMetricType = map[metric.NodeMetricType]MetricType{
		metric.TypeContainerCPUUsageSecondsPercentage: MetricTypeCPUUsage,
		metric.TypeContainerMemoryUsageBytes:          MetricTypeMemoryUsage,
	}
)

Functions

This section is empty.

Types

type Entity

type Entity struct {
	Timestamp   time.Time
	Namespace   *string
	PodName     *string
	Name        *string
	Metric      MetricType
	Granularity *string
	Kind        string

	ModelId      *string
	PredictionId *string
	Value        *string
}

Entity Container prediction entity in influxDB

func NewEntityFromMap

func NewEntityFromMap(data map[string]string) Entity

NewEntityFromMap Build entity from map

func (Entity) ContainerPrediction

func (e Entity) ContainerPrediction() prediction.ContainerPrediction

ContainerPrediction Create container prediction base on entity

type Field

type Field = string

type MetricType

type MetricType = string

type Tag

type Tag = string

Jump to

Keyboard shortcuts

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