Documentation
¶
Index ¶
- type BinaryArithmeticOperators
- type ComparisonOperator
- type LabelOperator
- type Query
- func (q *Query) AddSelector(key string, op LabelOperator, value string) *Query
- func (q *Query) Arithmetic(op BinaryArithmeticOperators, value string) *Query
- func (q *Query) Compare(compare ComparisonOperator, value string) *Query
- func (q *Query) Round(round float64) *Query
- func (q *Query) SumBy(labels ...string) *Query
- func (q *Query) ToPromql() string
- func (q *Query) Topk(topk int) *Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryArithmeticOperators ¶
type BinaryArithmeticOperators string
二元算术运算符
const ( Addition BinaryArithmeticOperators = "+" Subtraction BinaryArithmeticOperators = "-" Multiplication BinaryArithmeticOperators = "*" Division BinaryArithmeticOperators = "/" Modulo BinaryArithmeticOperators = "%" Power BinaryArithmeticOperators = "^" )
type ComparisonOperator ¶
type ComparisonOperator string
比较运算符
const ( Equal ComparisonOperator = "==" NotEqual ComparisonOperator = "!=" GreaterThan ComparisonOperator = ">" LessThan ComparisonOperator = "<" GreaterOrEqual ComparisonOperator = ">=" LessOrEqual ComparisonOperator = "<=" )
type LabelOperator ¶
type LabelOperator string
ref. https://prometheus.io/docs/prometheus/latest/querying/basics/#time-series-selectors
const ( LabelEqual LabelOperator = "=" LabelNotEqual LabelOperator = "!=" LabelRegex LabelOperator = "=~" LabelNotRegex LabelOperator = "!~" )
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) AddSelector ¶
func (q *Query) AddSelector(key string, op LabelOperator, value string) *Query
func (*Query) Arithmetic ¶
func (q *Query) Arithmetic(op BinaryArithmeticOperators, value string) *Query
Click to show internal directories.
Click to hide internal directories.