devops

package
v0.0.0-...-37fced7 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 5 Imported by: 59

Documentation

Index

Constants

View Source
const (

	// TableName is the name of the table where the time series data is stored for devops use case.
	TableName = "cpu"

	// DoubleGroupByDuration is the how big the time range for DoubleGroupBy query is
	DoubleGroupByDuration = 12 * time.Hour
	// HighCPUDuration is the how big the time range for HighCPU query is
	HighCPUDuration = 12 * time.Hour
	// MaxAllDuration is the how big the time range for MaxAll query is
	MaxAllDuration = 8 * time.Hour

	// LabelSingleGroupby is the label prefix for queries of the single groupby variety
	LabelSingleGroupby = "single-groupby"
	// LabelDoubleGroupby is the label prefix for queries of the double groupby variety
	LabelDoubleGroupby = "double-groupby"
	// LabelLastpoint is the label for the lastpoint query
	LabelLastpoint = "lastpoint"
	// LabelMaxAll is the label prefix for queries of the max all variety
	LabelMaxAll = "cpu-max-all"
	// LabelGroupbyOrderbyLimit is the label for groupby-orderby-limit query
	LabelGroupbyOrderbyLimit = "groupby-orderby-limit"
	// LabelHighCPU is the prefix for queries of the high-CPU variety
	LabelHighCPU = "high-cpu"
)

Variables

This section is empty.

Functions

func GetAllCPUMetrics

func GetAllCPUMetrics() []string

GetAllCPUMetrics returns all the metrics for CPU

func GetCPUMetricsLen

func GetCPUMetricsLen() int

GetCPUMetricsLen returns the number of metrics in CPU

func GetCPUMetricsSlice

func GetCPUMetricsSlice(numMetrics int) ([]string, error)

GetCPUMetricsSlice returns a subset of metrics for the CPU

func GetDoubleGroupByLabel

func GetDoubleGroupByLabel(dbName string, numMetrics int) string

GetDoubleGroupByLabel returns the Query human-readable label for DoubleGroupBy queries

func GetHighCPULabel

func GetHighCPULabel(dbName string, nHosts int) (string, error)

GetHighCPULabel returns the Query human-readable label for HighCPU queries

func GetMaxAllLabel

func GetMaxAllLabel(dbName string, nHosts int) string

GetMaxAllLabel returns the Query human-readable label for MaxAllCPU queries

func NewGroupBy

func NewGroupBy(numMetrics int) utils.QueryFillerMaker

NewGroupBy produces a function that produces a new Groupby for the given parameters

func NewGroupByOrderByLimit

func NewGroupByOrderByLimit(core utils.QueryGenerator) utils.QueryFiller

NewGroupByOrderByLimit returns a new GroupByOrderByLimit for given paremeters

func NewHighCPU

func NewHighCPU(hosts int) utils.QueryFillerMaker

NewHighCPU produces a new function that produces a new HighCPU

func NewLastPointPerHost

func NewLastPointPerHost(core utils.QueryGenerator) utils.QueryFiller

NewLastPointPerHost returns a new LastPointPerHost for given paremeters

func NewMaxAllCPU

func NewMaxAllCPU(hosts int, duration time.Duration) utils.QueryFillerMaker

NewMaxAllCPU produces a new function that produces a new AllMaxCPU

func NewSingleGroupby

func NewSingleGroupby(metrics, hosts, hours int) utils.QueryFillerMaker

NewSingleGroupby produces a new function that produces a new SingleGroupby

Types

type Core

type Core struct {
	*common.Core
}

Core is the common component of all generators for all systems

func NewCore

func NewCore(start, end time.Time, scale int) (*Core, error)

NewCore returns a new Core for the given time range and cardinality

func (*Core) GetRandomHosts

func (d *Core) GetRandomHosts(nHosts int) ([]string, error)

GetRandomHosts returns a random set of nHosts from a given Core

type DoubleGroupbyFiller

type DoubleGroupbyFiller interface {
	GroupByTimeAndPrimaryTag(query.Query, int)
}

DoubleGroupbyFiller is a type that can fill in a double groupby query

type GroupByOrderByLimit

type GroupByOrderByLimit struct {
	// contains filtered or unexported fields
}

GroupByOrderByLimit produces a filler for queries in the devops groupby-orderby-limit case.

func (*GroupByOrderByLimit) Fill

Fill fills in the query.Query with query details

type Groupby

type Groupby struct {
	// contains filtered or unexported fields
}

Groupby produces a QueryFiller for the devops groupby case.

func (*Groupby) Fill

func (d *Groupby) Fill(q query.Query) query.Query

Fill fills in the query.Query with query details

type GroupbyOrderbyLimitFiller

type GroupbyOrderbyLimitFiller interface {
	GroupByOrderByLimit(query.Query)
}

GroupbyOrderbyLimitFiller is a type that can fill in a groupby-orderby-limit query

type HighCPU

type HighCPU struct {
	// contains filtered or unexported fields
}

HighCPU produces a QueryFiller for the devops high-cpu cases

func (*HighCPU) Fill

func (d *HighCPU) Fill(q query.Query) query.Query

Fill fills in the query.Query with query details

type HighCPUFiller

type HighCPUFiller interface {
	HighCPUForHosts(query.Query, int)
}

HighCPUFiller is a type that can fill in a high-cpu query

type LastPointFiller

type LastPointFiller interface {
	LastPointPerHost(query.Query)
}

LastPointFiller is a type that can fill in a last point query

type LastPointPerHost

type LastPointPerHost struct {
	// contains filtered or unexported fields
}

LastPointPerHost returns QueryFiller for the devops lastpoint case

func (*LastPointPerHost) Fill

func (d *LastPointPerHost) Fill(q query.Query) query.Query

Fill fills in the query.Query with query details

type MaxAllCPU

type MaxAllCPU struct {
	// contains filtered or unexported fields
}

MaxAllCPU contains info for filling in a query.Query for "max all" queries

func (*MaxAllCPU) Fill

func (d *MaxAllCPU) Fill(q query.Query) query.Query

Fill fills in the query.Query with query details

type MaxAllFiller

type MaxAllFiller interface {
	MaxAllCPU(query.Query, int, time.Duration)
}

MaxAllFiller is a type that can fill in a max all CPU metrics query

type SingleGroupby

type SingleGroupby struct {
	// contains filtered or unexported fields
}

SingleGroupby contains info for filling in single groupby queries

func (*SingleGroupby) Fill

func (d *SingleGroupby) Fill(q query.Query) query.Query

Fill fills in the query.Query with query details

type SingleGroupbyFiller

type SingleGroupbyFiller interface {
	GroupByTime(query.Query, int, int, time.Duration)
}

SingleGroupbyFiller is a type that can fill in a single groupby query

Jump to

Keyboard shortcuts

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