activeseriesmodel

package
v0.0.0-...-f8e07d0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomTrackersConfig

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

CustomTrackersConfig configures active series custom trackers. It can be set using a flag, or parsed from yaml.

func NewCustomTrackersConfig

func NewCustomTrackersConfig(m map[string]string) (c CustomTrackersConfig, err error)

func (CustomTrackersConfig) Empty

func (c CustomTrackersConfig) Empty() bool

func (CustomTrackersConfig) Equal

Equal compares two CustomTrackersConfig. This is needed to allow cmp.Equal to compare two CustomTrackersConfig.

func (CustomTrackersConfig) ExampleDoc

func (c CustomTrackersConfig) ExampleDoc() (comment string, yaml interface{})

ExampleDoc provides an example doc for this config, especially valuable since it's custom-unmarshaled.

func (CustomTrackersConfig) MarshalYAML

func (c CustomTrackersConfig) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (*CustomTrackersConfig) Set

func (c *CustomTrackersConfig) Set(s string) error

Set implements flag.Value, and is used to set the config value from a flag value provided as string.

func (CustomTrackersConfig) String

func (c CustomTrackersConfig) String() string

String is a canonical representation of the config, it is compatible with flag definition. String is also needed to implement flag.Value.

func (*CustomTrackersConfig) UnmarshalYAML

func (c *CustomTrackersConfig) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface. CustomTrackersConfig are marshaled in yaml as a map[string]string, with matcher names as keys and strings as matchers definitions.

type Matchers

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

func NewMatchers

func NewMatchers(matchersConfig CustomTrackersConfig) *Matchers

func (*Matchers) Config

func (m *Matchers) Config() CustomTrackersConfig

func (*Matchers) Len

func (m *Matchers) Len() int

func (*Matchers) Less

func (m *Matchers) Less(i, j int) bool

func (*Matchers) MatcherNames

func (m *Matchers) MatcherNames() []string

func (*Matchers) Matches

func (m *Matchers) Matches(series labels.Labels) PreAllocDynamicSlice

Matches returns a PreAllocDynamicSlice containing only matcher indexes which are matching

func (*Matchers) Swap

func (m *Matchers) Swap(i, j int)

type PreAllocDynamicSlice

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

PreAllocDynamicSlice is a slice-like uint16 data structure that allocates space for the first `preAllocatedSize` elements. When more than `preAllocatedSize` elements are appended, it allocates a slice that escapes to heap. This trades in extra allocated space (2x more with `preAllocatedSize=3`) for zero-allocations in most of the cases, relying on the assumption that most of the matchers will not match more than `preAllocatedSize` trackers.

func (*PreAllocDynamicSlice) Append

func (fs *PreAllocDynamicSlice) Append(val int)

func (*PreAllocDynamicSlice) Get

func (fs *PreAllocDynamicSlice) Get(idx int) uint16

func (*PreAllocDynamicSlice) Len

func (fs *PreAllocDynamicSlice) Len() int

Jump to

Keyboard shortcuts

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