definition

package
v1.26.9 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: 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 EntityIDGeneratorFunc

type EntityIDGeneratorFunc func(groupLabel, rawEntityID string, g RawGroups) (string, error)

EntityIDGeneratorFunc generates an entity ID.

type EntityTypeGeneratorFunc

type EntityTypeGeneratorFunc func(groupLabel, rawEntityID string, g RawGroups, prefix string) (string, error)

EntityTypeGeneratorFunc generates an entity type.

type FetchFunc

type FetchFunc func(groupLabel, entityID string, groups RawGroups) (FetchedValue, error)

FetchFunc fetches values or values from raw metric groups. Return FetchedValues if you want to prototype metrics.

func FromRaw

func FromRaw(metricKey string) FetchFunc

FromRaw fetches metrics from raw metrics. Is the most simple use case.

func Transform

func Transform(fetchFunc FetchFunc, transformFunc TransformFunc) FetchFunc

Transform return a new FetchFunc that applies the transformFunc to the result of the fetchFunc passed as argument

type FetchedValue

type FetchedValue interface{}

FetchedValue is just any value from an already fetched metric.

type FetchedValues

type FetchedValues map[string]FetchedValue

FetchedValues is a map of FetchedValue indexed by metric name.

type GuessFunc

type GuessFunc func(clusterName, groupLabel, entityID string, groups RawGroups) (string, error)

GuessFunc guesses from data.

type MetricSetManipulator

type MetricSetManipulator func(ms metric.MetricSet, entity sdk.Entity, clusterName string) error

MetricSetManipulator manipulates the MetricSet for a given entity and clusterName

type PopulateFunc

type PopulateFunc func(RawGroups, SpecGroups) (bool, []error)

PopulateFunc populates raw metric groups using your specs

func IntegrationProtocol2PopulateFunc

func IntegrationProtocol2PopulateFunc(
	i *sdk.IntegrationProtocol2,
	clusterName string,
	k8sVersion *version.Info,
	msTypeGuesser GuessFunc,
	msManipulators ...MetricSetManipulator,
) PopulateFunc

IntegrationProtocol2PopulateFunc populates an integration protocol v2 with the given metrics and definition.

type RawGroups

type RawGroups map[string]map[string]RawMetrics

RawGroups are grouped raw metrics. map[entityType][entityName][metricName]metricValue as interface{}

type RawGroupsMultipleMetrics

type RawGroupsMultipleMetrics RawGroups

type RawMetrics

type RawMetrics map[string]RawValue

RawMetrics is a map of RawValue indexed by metric name.

type RawValue

type RawValue interface{}

RawValue is just any value from a raw metric.

type Spec

type Spec struct {
	Name      string
	ValueFunc FetchFunc
	Type      sdk.SourceType
	Optional  bool
}

Spec is a metric specification.

type SpecGroup

type SpecGroup struct {
	IDGenerator   EntityIDGeneratorFunc
	TypeGenerator EntityTypeGeneratorFunc
	Specs         []Spec
}

SpecGroup represents a bunch of specs that share logic.

type SpecGroups

type SpecGroups map[string]SpecGroup

SpecGroups is a map of groups indexed by group name.

type TransformFunc

type TransformFunc func(FetchedValue) (FetchedValue, error)

TransformFunc transforms a FetchedValue.

Jump to

Keyboard shortcuts

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