config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMetricConfigFile = ""
)

Variables

View Source
var (
	Now = time.Now().UTC()
)

Functions

func MustParseUrl added in v0.0.3

func MustParseUrl(value string) *url.URL

func NewListenAddressValue added in v0.0.3

func NewListenAddressValue(p *ListenAddress, val ListenAddress) *listenAddressValue

func NewMatchersValue added in v0.0.3

func NewMatchersValue(p *map[string][]*labels.Matcher) *matchersValue

func NewMetricConfigValue added in v0.0.3

func NewMetricConfigValue(p *MetricConfig) *metricConfigValue

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

func NewUrlValue added in v0.0.3

func NewUrlValue(p **url.URL, val *url.URL) *urlValue

Types

type BackfillConfig

type BackfillConfig struct {
	Start            time.Time
	End              time.Time
	SampleInterval   time.Duration
	RuleConfig       RecordingRules
	RuleGroupFilters []*regexp.Regexp
	RuleNameFilters  []*regexp.Regexp
	Directory        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 FileFlag added in v0.0.3

type FileFlag interface {
	Flag
	Extensions(extensions ...string) FileFlag
}

type Flag added in v0.0.3

type Flag interface {
	Required() Flag
}

type FlagBuilder added in v0.0.3

type FlagBuilder interface {
	TimeRange(startDest *time.Time, endDest *time.Time, usage string) Flag
	StartTime(dest *time.Time, usage string) Flag
	EndTime(dest *time.Time, usage string) Flag
	Time(dest *time.Time, name string, defaultValue time.Time, usage string) Flag
	OutputDirectory(dest *string, usage string) Flag
	Directory(dest *string, usage string) Flag
	MetricConfig(dest *MetricConfig, usage string) FileFlag
	File(dest *string, name string, defaultValue string, usage string) FileFlag
	SampleInterval(dest *time.Duration, usage string) Flag
	Duration(dest *time.Duration, name string, defaultValue time.Duration, usage string) Flag
	RecordingRules(dest *RecordingRules, usage string) Flag
	Parallelism(dest *uint8, defaultValue uint8, usage string) Flag
	Regex(dest *[]*regexp.Regexp, name string, defaultValue []*regexp.Regexp, usage string) Flag
	RuleGroupFilters(dest *[]*regexp.Regexp, usage string) Flag
	RuleNameFilters(dest *[]*regexp.Regexp, usage string) Flag
	URL(dest **url.URL, name string, defaultValue *url.URL, usage string) Flag
	Host(dest **url.URL, usage string) Flag
	Matchers(dest *map[string][]*labels.Matcher, usage string) Flag
	ListenAddress(dest *ListenAddress, usage string) Flag
}

func NewFlagBuilder added in v0.0.3

func NewFlagBuilder(cmd *cobra.Command) FlagBuilder

type GenerateConfig

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

GenerateConfig represents the configuration of the generate command.

type ListenAddress added in v0.0.3

type ListenAddress struct {
	Host string
	Port int
}

func (ListenAddress) String added in v0.0.3

func (l ListenAddress) String() string

type MetricConfig

type MetricConfig struct {
	TimeSeries TimeSeries `yaml:"timeSeries"`
}

type MigrateConfig

type MigrateConfig struct {
	Host            *url.URL
	Start           time.Time
	End             time.Time
	SampleInterval  time.Duration
	Matchers        map[string][]*labels.Matcher
	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 TimeSeries added in v0.0.3

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

type WebConfig added in v0.0.3

type WebConfig struct {
	ListenAddress  ListenAddress
	Host           *url.URL
	SampleInterval time.Duration
	Parallelism    uint8
}

WebConfig represents the configuration of the web command.

Jump to

Keyboard shortcuts

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