tests

package
v0.17.0-patch2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepClone

func DeepClone(original map[parser.MetricRequest][]*types.MetricData) map[parser.MetricRequest][]*types.MetricData

func DeepEqual

func DeepEqual(t *testing.T, target string, original, modified map[parser.MetricRequest][]*types.MetricData, compareTags bool)

func DummyEvaluator added in v0.13.0

func DummyEvaluator() interfaces.Evaluator

func EvaluatorFromFunc

func EvaluatorFromFunc(function interfaces.Function) interfaces.Evaluator

func EvaluatorFromFuncWithMetadata

func EvaluatorFromFuncWithMetadata(metadata map[string]interfaces.Function) interfaces.Evaluator

func GenerateValues added in v0.17.0

func GenerateValues(start, stop, step int64) (values []float64)

func InitTestSummarize

func InitTestSummarize() (int64, int64, int64)

func TestEvalExpr

func TestEvalExpr(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItem)

func TestEvalExprModifiedOrigin added in v0.14.1

func TestEvalExprModifiedOrigin(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItem, from, until int64, strictOrder, compareTags bool) error

func TestEvalExprOrdered added in v0.15.3

func TestEvalExprOrdered(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItem)

func TestEvalExprResult added in v0.16.0

func TestEvalExprResult(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItem)

func TestEvalExprWithCustomValidation added in v0.16.0

func TestEvalExprWithCustomValidation(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItemWithCustomValidation)

func TestEvalExprWithError added in v0.15.3

func TestEvalExprWithError(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItemWithError)

func TestEvalExprWithOptions added in v0.16.0

func TestEvalExprWithOptions(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItem, compareTags bool)

func TestEvalExprWithRange added in v0.15.5

func TestEvalExprWithRange(t *testing.T, eval interfaces.Evaluator, tt *EvalTestItemWithRange)

func TestMultiReturnEvalExpr

func TestMultiReturnEvalExpr(t *testing.T, eval interfaces.Evaluator, tt *MultiReturnEvalTestItem)

func TestRewriteExpr added in v0.13.0

func TestRewriteExpr(t *testing.T, eval interfaces.Evaluator, tt *RewriteTestItem)

func TestSummarizeEvalExpr

func TestSummarizeEvalExpr(t *testing.T, eval interfaces.Evaluator, tt *SummarizeEvalTestItem)

Types

type EvalTestItem

type EvalTestItem struct {
	//E    parser.Expr
	Target string
	M      map[parser.MetricRequest][]*types.MetricData
	Want   []*types.MetricData
}

type EvalTestItemWithCustomValidation added in v0.16.0

type EvalTestItemWithCustomValidation struct {
	Target    string
	M         map[parser.MetricRequest][]*types.MetricData
	Validator func(*testing.T, []*types.MetricData)
	From      int64
	Until     int64
}

type EvalTestItemWithError added in v0.15.3

type EvalTestItemWithError struct {
	Target string
	M      map[parser.MetricRequest][]*types.MetricData
	Want   []*types.MetricData
	Error  error
}

type EvalTestItemWithRange added in v0.15.5

type EvalTestItemWithRange struct {
	Target string
	M      map[parser.MetricRequest][]*types.MetricData
	Want   []*types.MetricData
	From   int64
	Until  int64
}

func (*EvalTestItemWithRange) TestItem added in v0.15.5

func (r *EvalTestItemWithRange) TestItem() *EvalTestItem

type FuncEvaluator

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

func (*FuncEvaluator) Eval added in v0.13.0

func (evaluator *FuncEvaluator) Eval(ctx context.Context, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error)

func (*FuncEvaluator) Fetch added in v0.16.1

func (evaluator *FuncEvaluator) Fetch(_ context.Context, _ []parser.Expr, _, _ int64, values map[parser.MetricRequest][]*types.MetricData) (map[parser.MetricRequest][]*types.MetricData, error)

type MultiReturnEvalTestItem

type MultiReturnEvalTestItem struct {
	Target  string
	M       map[parser.MetricRequest][]*types.MetricData
	Name    string
	Results map[string][]*types.MetricData
}

type RewriteTestError added in v0.16.1

type RewriteTestError struct {
	//E    parser.Expr
	Target string
	M      map[parser.MetricRequest][]*types.MetricData
	Want   error
}

type RewriteTestItem added in v0.13.0

type RewriteTestItem struct {
	//E    parser.Expr
	Target string
	M      map[parser.MetricRequest][]*types.MetricData
	Want   RewriteTestResult
}

type RewriteTestResult added in v0.13.0

type RewriteTestResult struct {
	Rewritten bool
	Targets   []string
	Err       error
}

type SummarizeEvalTestItem

type SummarizeEvalTestItem struct {
	Target string
	M      map[parser.MetricRequest][]*types.MetricData
	Want   []float64
	From   int64
	Until  int64
	Name   string
	Step   int64
	Start  int64
	Stop   int64
}

type TestZipper added in v0.17.0

type TestZipper struct {
	M map[parser.MetricRequest][]*types.MetricData
}

func NewTestZipper added in v0.17.0

func NewTestZipper(m map[parser.MetricRequest][]*types.MetricData) TestZipper

func (TestZipper) Find added in v0.17.0

func (TestZipper) Info added in v0.17.0

func (TestZipper) Render added in v0.17.0

func (TestZipper) RenderCompat added in v0.17.0

func (zp TestZipper) RenderCompat(ctx context.Context, metrics []string, from, until int64) ([]*types.MetricData, *zipperTypes.Stats, merry.Error)

func (TestZipper) ScaleToCommonStep added in v0.17.0

func (zp TestZipper) ScaleToCommonStep() bool

func (TestZipper) TagNames added in v0.17.0

func (zp TestZipper) TagNames(ctx context.Context, query string, limit int64) ([]string, merry.Error)

func (TestZipper) TagValues added in v0.17.0

func (zp TestZipper) TagValues(ctx context.Context, query string, limit int64) ([]string, merry.Error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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