schemas

package
v4.3.942+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColumnTypeValue = map[string]ColumnType{
	"undefined": ColumnTypeUndefined,
	"tag":       Tag,
	"field":     Field,
}
View Source
var DatabaseNameMap = map[Scope]string{
	Application:    "alameda_application",
	Fedemeter:      "alameda_fedemeter",
	Metric:         "alameda_metric",
	Planning:       "alameda_planning",
	Prediction:     "alameda_prediction",
	Recommendation: "alameda_recommendation",
	Resource:       "alameda_cluster_status",
	Target:         "alameda_target",
}
View Source
var MeasurementNameMap = map[Scope]string{
	Application:    "application",
	Fedemeter:      "fedemeter",
	Metric:         "metric",
	Planning:       "planning",
	Prediction:     "prediction",
	Recommendation: "recommendation",
	Resource:       "resource",
	Target:         "target",
}
View Source
var MeasurementSchemaNameMap = map[Scope]string{
	Application:    "application_schema",
	Fedemeter:      "fedemeter_schema",
	Metric:         "metric_schema",
	Planning:       "planning_schema",
	Prediction:     "prediction_schema",
	Recommendation: "recommendation_schema",
	Resource:       "resource_schema",
	Target:         "target_schema",
}
View Source
var MetricTypeValue = map[string]MetricType{
	"undefined":                MetricTypeUndefined,
	"cpu_seconds_total":        CPUSecondsTotal,
	"cpu_cores_alloc":          CPUCoresAllocatable,
	"cpu_millicores_total":     CPUMilliCoresTotal,
	"cpu_millicores_avail":     CPUMilliCoresAvail,
	"cpu_millicores_usage":     CPUMilliCoresUsage,
	"cpu_millicores_usage_pct": CPUMilliCoresUsagePCT,
	"memory_bytes_alloc":       MemoryBytesAllocatable,
	"memory_bytes_total":       MemoryBytesTotal,
	"memory_bytes_avail":       MemoryBytesAvail,
	"memory_bytes_usage":       MemoryBytesUsage,
	"memory_bytes_usage_pct":   MemoryBytesUsagePCT,
	"fs_bytes_total":           FSBytesTotal,
	"fs_bytes_avail":           FSBytesAvail,
	"fs_bytes_usage":           FSBytesUsage,
	"fs_bytes_usage_pct":       FSBytesUsagePCT,
	"http_req_count":           HttpRequestsCount,
	"http_req_total":           HttpRequestsTotal,
	"http_response_count":      HttpResponseCount,
	"http_response_total":      HttpResponseTotal,
	"disk_io_seconds_total":    DiskIOSecondsTotal,
	"disk_io_util":             DiskIOUtilization,
	"restarts_total":           RestartsTotal,
	"unschedulable":            Unschedulable,
	"health":                   Health,
	"power_usage_watts":        PowerUsageWatts,
	"temperature_celsius":      TemperatureCelsius,
	"duty_cycle":               DutyCycle,
	"current_offset":           CurrentOffset,
	"lag":                      Lag,
	"latency":                  Latency,
	"number":                   Number,
}
View Source
var ResourceBoundaryValue = map[string]ResourceBoundary{
	"undefined":   ResourceBoundaryUndefined,
	"raw":         ResourceRaw,
	"upper_bound": ResourceUpperBound,
	"lower_bound": ResourceLowerBound,
}
View Source
var ResourceQuotaValue = map[string]ResourceQuota{
	"undefined":       ResourceQuotaUndefined,
	"limit":           ResourceLimit,
	"request":         ResourceRequest,
	"initial_limit":   ResourceInitialLimit,
	"initial_request": ResourceInitialRequest,
}
View Source
var ScopeValue = map[string]Scope{
	"undefined":      ScopeUndefined,
	"application":    Application,
	"fedemeter":      Fedemeter,
	"metric":         Metric,
	"planning":       Planning,
	"prediction":     Prediction,
	"recommendation": Recommendation,
	"resource":       Resource,
	"target":         Target,
}

Functions

func CompareMeasurement

func CompareMeasurement(old *Measurement, new *Measurement) bool

func CompareSchemaMeta

func CompareSchemaMeta(old *SchemaMeta, new *SchemaMeta) bool

Types

type Column

type Column struct {
	Name       string
	Required   bool
	ColumnType ColumnType
	DataType   common.DataType
}

func NewColumn

func NewColumn() *Column

func (*Column) Parse

func (p *Column) Parse(column string) error

func (*Column) String

func (p *Column) String() string

type ColumnType

type ColumnType int
const (
	ColumnTypeUndefined ColumnType = iota
	Tag
	Field
)

Influxdb column type enumerator

type Measurement

type Measurement struct {
	Name       string
	MetricType MetricType
	Boundary   ResourceBoundary
	Quota      ResourceQuota
	IsTS       bool
	Columns    []*Column
}

func NewMeasurement

func NewMeasurement(name string, metricType MetricType, boundary ResourceBoundary, quota ResourceQuota, isTS bool) *Measurement

func (*Measurement) AddColumn

func (p *Measurement) AddColumn(name string, required bool, columnType ColumnType, dataType common.DataType)

func (*Measurement) ColumnRequired

func (p *Measurement) ColumnRequired(columns []string) error

func (*Measurement) ColumnSupported

func (p *Measurement) ColumnSupported(columns []string) error

func (*Measurement) ColumnTag

func (p *Measurement) ColumnTag(columns []string) error

func (*Measurement) Copy

func (p *Measurement) Copy(measurement *Measurement) error

func (*Measurement) GetFields

func (p *Measurement) GetFields() []*Column

func (*Measurement) GetTags

func (p *Measurement) GetTags() []*Column

func (*Measurement) Initialize

func (p *Measurement) Initialize(columns string) error

func (*Measurement) String

func (p *Measurement) String() string

type MetricType

type MetricType int
const (
	MetricTypeUndefined MetricType = iota
	CPUSecondsTotal
	CPUCoresAllocatable
	CPUMilliCoresTotal
	CPUMilliCoresAvail
	CPUMilliCoresUsage
	CPUMilliCoresUsagePCT
	MemoryBytesAllocatable
	MemoryBytesTotal
	MemoryBytesAvail
	MemoryBytesUsage
	MemoryBytesUsagePCT
	FSBytesTotal
	FSBytesAvail
	FSBytesUsage
	FSBytesUsagePCT
	HttpRequestsCount
	HttpRequestsTotal
	HttpResponseCount
	HttpResponseTotal
	DiskIOSecondsTotal
	DiskIOUtilization
	RestartsTotal
	Unschedulable
	Health
	PowerUsageWatts
	TemperatureCelsius
	DutyCycle
	CurrentOffset
	Lag
	Latency
	Number
)

Metric type enumerator

type ResourceBoundary

type ResourceBoundary int
const (
	ResourceBoundaryUndefined ResourceBoundary = iota
	ResourceRaw
	ResourceUpperBound
	ResourceLowerBound
)

Resource boundary enumerator

type ResourceQuota

type ResourceQuota int
const (
	ResourceQuotaUndefined ResourceQuota = iota
	ResourceLimit
	ResourceRequest
	ResourceInitialLimit
	ResourceInitialRequest
)

Resource quota enumerator

type Schema

type Schema struct {
	SchemaMeta   *SchemaMeta
	Measurements []*Measurement
}

func NewSchema

func NewSchema(scope Scope, category, schemaType string) *Schema

func (*Schema) AddMeasurement

func (p *Schema) AddMeasurement(name string, metricType MetricType, boundary ResourceBoundary, quota ResourceQuota, isTS bool, columns string) error

func (*Schema) GetMeasurement

func (p *Schema) GetMeasurement(name string, metricType MetricType, boundary ResourceBoundary, quota ResourceQuota) *Measurement

func (*Schema) String

func (p *Schema) String() string

func (*Schema) Validate

func (p *Schema) Validate() error

type SchemaMeta

type SchemaMeta struct {
	Scope    Scope
	Category string
	Type     string
}

func NewSchemaMeta

func NewSchemaMeta(scope Scope, category, schemaType string) *SchemaMeta

type Scope

type Scope int
const (
	ScopeUndefined Scope = iota
	Application
	Fedemeter
	Metric
	Planning
	Prediction
	Recommendation
	Resource
	Target
)

Table enumerator

Jump to

Keyboard shortcuts

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