model

package
v1.6.65 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHE_LABEL_STRING_TAG  = "__cache_label_string__"
	PROMETHEUS_LABELS_INDEX = "__labels_index__"
)

Variables

View Source
var MatrixCallFunctions = []string{"topk", "bottomk",
	"avg_over_time", "count_over_time", "last_over_time", "max_over_time", "min_over_time", "stddev_over_time", "sum_over_time", "present_over_time", "quantile_over_time",
	"idelta", "delta", "increase", "irate", "rate"}
View Source
var RelabelFunctions = []string{"sum", "avg", "count", "min", "max", "group", "stddev", "stdvar", "count_values", "quantile"}

Functions

This section is empty.

Types

type DeepFlowPromRequest

type DeepFlowPromRequest struct {
	Slimit      int
	Start       int64
	End         int64
	Step        time.Duration
	Query       string
	OrgID       string
	BlockTeamID []string
	Matchers    []string
}

type PromMetaParams

type PromMetaParams struct {
	StartTime   string
	EndTime     string
	LabelName   string
	OrgID       string
	BlockTeamID []string
	Context     context.Context
}

type PromQueryData

type PromQueryData struct {
	ResultType parser.ValueType `json:"resultType"`
	Result     parser.Value     `json:"result"`
}

type PromQueryParams

type PromQueryParams struct {
	Debug       bool
	Offloading  bool
	Slimit      int
	Promql      string
	StartTime   string
	EndTime     string
	Step        string
	OrgID       string
	Matchers    []string
	BlockTeamID []string
	Context     context.Context
}

type PromQueryResponse

type PromQueryResponse struct {
	Status    string           `json:"status"`
	Data      interface{}      `json:"data,omitempty"`
	ErrorType errorType        `json:"errorType,omitempty"`
	Error     string           `json:"error,omitempty"`
	Stats     []PromQueryStats `json:"stats,omitempty"`
}

type PromQueryStats

type PromQueryStats struct {
	Duration   float64 `json:"duration,omitempty"`
	SQL        string  `json:"sql,omitempty"`
	QuerierSQL string  `json:"querier_sql,omitempty"`
}

type PromQueryWrapper

type PromQueryWrapper struct {
	OptStatus   string                     `json:"OPT_STATUS"`
	Type        string                     `json:"TYPE"` // promql
	Description string                     `json:"DESCRIPTION"`
	Schemas     struct{}                   `json:"SCHEMAS"`
	Data        [](map[string]interface{}) `json:"DATA"`
}

type Querierable

type Querierable interface {
	storage.Queryable
	// get sql and sql cost duration
	GetSQLQuery() []PromQueryStats

	BindSelectedCallBack(promql.Query)
	AfterQueryExec(promql.Query)
}

type QueryRequest

type QueryRequest interface {
	// GetStart returns the start timestamp of query, unit: ms
	GetStart() int64

	// GetEnd returns the end timestamp of query, unit: ms
	GetEnd() int64

	// GetStep returns the query step of range-query
	GetStep() int64

	// GetFunc returns the query aggregation functions of query
	GetFunc() []string

	// GetGrouping returns the group labels for query functions of query
	GetGrouping(f string) []string

	// GetBy returns the group way for group labels of query
	GetBy() bool

	// GetQuery returns the whole query promql of query
	GetQuery() string

	// GetMetric returns the metric name of query
	GetMetric() string

	// GetLables returns query labels of query
	GetLabels() []*labels.Matcher

	// GetRange returns the range of query function
	GetRange(f string) int64

	// GetFuncParam returns query params of query function, only for 'topk'/'quantile'/'bottomk'
	GetFuncParam(f string) float64

	// GetSubStep returns query step in subQuery, like [15m:1m], get `1m` (60000ms) from this
	GetSubStep(f string) int64
}

type QueryType

type QueryType uint8
const (
	// Series Query
	Series QueryType = iota
	// Instant Query
	Instant
	// Range Query
	Range
)

type WrapHistorySeries

type WrapHistorySeries struct {
	Toi   int64   `json:"toi"`
	Value float64 `json:"value"`
}

Jump to

Keyboard shortcuts

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