Documentation
¶
Index ¶
- type ExprType
- type Option
- func WithAtModifierMaxTimestamp(atModifierMaxTimestamp int64) Option
- func WithEnableAtModifier(enableAtModifier bool) Option
- func WithEnableExperimentalPromQLFunctions(enableExperimentalPromQLFunctions bool) Option
- func WithEnableOffset(enableOffset bool) Option
- func WithEnableVectorMatching(enableVectorMatching bool) Option
- func WithEnabledAggrs(enabledAggrs []parser.ItemType) Option
- func WithEnabledBinOps(enabledBinops []parser.ItemType) Option
- func WithEnabledExprs(enabledExprs []ExprType) Option
- func WithEnabledFunctions(enabledFunctions []*parser.Function) Option
- func WithEnforceLabelMatchers(matchers []*labels.Matcher) Option
- func WithMaxDepth(depth int) Option
- type PromQLSmith
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option specifies options when generating queries.
func WithEnableAtModifier ¶
func WithEnableOffset ¶
func WithEnabledAggrs ¶
func WithEnabledBinOps ¶
func WithEnabledExprs ¶
func WithEnabledFunctions ¶
func WithMaxDepth ¶
WithMaxDepth sets the maximum depth for generated query expressions
type PromQLSmith ¶
type PromQLSmith struct {
// contains filtered or unexported fields
}
func (*PromQLSmith) Walk ¶
func (s *PromQLSmith) Walk(valueTypes ...parser.ValueType) parser.Expr
Walk will walk the ast tree using one of the randomly generated expr type.
func (*PromQLSmith) WalkInstantQuery ¶
func (s *PromQLSmith) WalkInstantQuery() parser.Expr
WalkInstantQuery walks the ast and generate an expression that can be used in instant query. Instant query also supports string literal, but we skip it here.
func (*PromQLSmith) WalkRangeQuery ¶
func (s *PromQLSmith) WalkRangeQuery() parser.Expr
WalkRangeQuery walks the ast and generate an expression that can be used in range query.
func (*PromQLSmith) WalkSelectors ¶
func (s *PromQLSmith) WalkSelectors() []*labels.Matcher
WalkSelectors generates random label matchers based on the input series labels.
Click to show internal directories.
Click to hide internal directories.