config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSampleInterval = time.Second * 15

	DefaultHost = "localhost"

	DefaultPort = 9089

	DefaultScheme = Http

	DefaultDataDirectory = "data/"
)
View Source
const (
	DefaultMetricConfigFile = ""
)

Variables

View Source
var (
	DefaultMatcher          []string
	DefaultRuleGroupFilters = []*regexp.Regexp{regexp.MustCompile(".+")}
	DefaultRuleNameFilters  = []*regexp.Regexp{regexp.MustCompile(".+")}
	YamlFileExtensions      = []string{"yml", "yaml"}
)
View Source
var (
	Now = time.Now().UTC()
)

Functions

func NewRecordingRulesValue

func NewRecordingRulesValue(p *RecordingRules) *recordingRulesArrayValue

func NewRegexValue

func NewRegexValue(p *[]*regexp.Regexp, val []*regexp.Regexp) *regexArrayValue

func NewTimeValue

func NewTimeValue(p *time.Time, val time.Time) *timeValue

Types

type BackfillConfig

type BackfillConfig struct {
	Start            time.Time
	End              time.Time
	SampleInterval   time.Duration
	RuleConfig       RecordingRules
	RuleGroupFilters []*regexp.Regexp
	RuleNameFilters  []*regexp.Regexp
	OutputDirectory  string
	Parallelism      uint8
}

BackfillConfig represents the configuration of the backfill command.

type CompactConfig

type CompactConfig struct {
	Directory string
}

CompactConfig represents the configuration of the compact command.

type GenerateConfig

type GenerateConfig struct {
	Start            time.Time
	End              time.Time
	OutputDirectory  string
	SampleInterval   time.Duration
	MetricConfigFile string
	MetricConfig     *MetricConfig
	RuleConfig       RecordingRules
	Parallelism      uint8
}

GenerateConfig represents the configuration of the generate command.

type MetricConfig

type MetricConfig struct {
	TimeSeries []struct {
		Name       string              `yaml:"name"`
		Instances  []string            `yaml:"instances"`
		Labels     []map[string]string `yaml:"labels"`
		Expression string              `yaml:"expression"`
	} `yaml:"timeSeries"`
}

type MigrateConfig

type MigrateConfig struct {
	Scheme                Scheme
	Host                  string
	Port                  uint16
	Start                 time.Time
	End                   time.Time
	SampleInterval        time.Duration
	MatcherSetExpressions []string
	OutputDirectory       string
	Parallelism           uint8
}

MigrateConfig represents the configuration of the migrate command.

type RecordingRule

type RecordingRule struct {
	rules.Rule
	Group string
}

func (RecordingRule) String

func (r RecordingRule) String() string

type RecordingRules

type RecordingRules []*RecordingRule

type Scheme

type Scheme string
const (
	Http  Scheme = "http"
	Https Scheme = "https"
)

func NewSchemeValue

func NewSchemeValue(val Scheme, p *Scheme) *Scheme

func (*Scheme) Set

func (e *Scheme) Set(v string) error

Set must have pointer receiver so it doesn't change the value of a copy

func (*Scheme) String

func (e *Scheme) String() string

String is used both by fmt.Print and by Cobra in help text

func (*Scheme) Type

func (e *Scheme) Type() string

Type is only used in help text

Jump to

Keyboard shortcuts

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