model

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObservaTracePromRequest

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

type PromMetaParams

type PromMetaParams struct {
	StartTime string
	EndTime   string
	LabelName 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
	Matchers   []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
}

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