config

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjustValueTolerance

type AdjustValueTolerance struct {
	Fraction *float64 `yaml:"fraction" json:"fraction,omitempty"`
	Margin   *float64 `yaml:"margin" json:"margin,omitempty"`
}

type Config

type Config struct {
	ReferenceTargetConfig TargetConfig        `yaml:"reference_target_config"`
	TestTargetConfig      TargetConfig        `yaml:"test_target_config"`
	QueryTweaks           []*QueryTweak       `yaml:"query_tweaks"`
	TestCases             []*TestCase         `yaml:"test_cases"`
	QueryTimeParameters   QueryTimeParameters `yaml:"query_time_parameters"`
}

Config models the main configuration file.

func Load

func Load(content []byte) (*Config, error)

Load parses the YAML input into a Config.

func LoadFromFiles

func LoadFromFiles(filenames []string) (*Config, error)

LoadFromFiles parses the given YAML files into a Config.

type QueryTimeParameters

type QueryTimeParameters struct {
	EndTime             string  `yaml:"end_time"`
	RangeInSeconds      float64 `yaml:"range_in_seconds"`
	ResolutionInSeconds float64 `yaml:"resolution_in_seconds"`
}

type QueryTweak

type QueryTweak struct {
	Note                   string                `yaml:"note" json:"note"`
	NoBug                  bool                  `yaml:"no_bug,omitempty" json:"noBug,omitempty"`
	TruncateTimestampsToMS int64                 `yaml:"truncate_timestamps_to_ms" json:"truncateTimestampsToMS,omitempty"`
	AlignTimestampsToStep  bool                  `yaml:"align_timestamps_to_step" json:"alignTimestampsToStep,omitempty"`
	OffsetTimestampsByMS   int64                 `yaml:"offset_timestamps_by_ms" json:"offsetTimestampsByMS,omitempty"`
	DropResultLabels       []model.LabelName     `yaml:"drop_result_labels" json:"dropResultLabels,omitempty"`
	IgnoreFirstStep        bool                  `yaml:"ignore_first_step" json:"ignoreFirstStep,omitempty"`
	IgnoreCase             bool                  `yaml:"ignore_case" json:"ignoreCase,omitempty"`
	AdjustValueTolerance   *AdjustValueTolerance `yaml:"adjust_value_tolerance" json:"adjustValueTolerance,omitempty"`
}

A QueryTweak restricts or modifies a query in certain ways that avoids certain systematic errors and/or later comparison problems.

type TargetConfig

type TargetConfig struct {
	QueryURL      string            `yaml:"query_url"`
	BasicAuthUser string            `yaml:"basic_auth_user"`
	BasicAuthPass string            `yaml:"basic_auth_pass"`
	Headers       map[string]string `yaml:"headers"`
	TSDBPath      string            `yaml:"tsdb_path"`
}

TargetConfig represents the configuration of a single Prometheus API endpoint.

type TestCase

type TestCase struct {
	Query          string   `yaml:"query"`
	VariantArgs    []string `yaml:"variant_args,omitempty"`
	SkipComparison bool     `yaml:"skip_comparison,omitempty"`
	ShouldFail     bool     `yaml:"should_fail,omitempty"`
}

TestCase represents a given query (pattern) to be tested.

Jump to

Keyboard shortcuts

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