logical

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const AndType = "and"

AndType uses values from left hand side for which there is a value in right hand side with exactly matching label sets. Other elements are replaced by NaNs. The metric name and values are carried over from the left-hand side.

View Source
const OrType = "or"

OrType uses all values from left hand side, and appends values from the right hand side which do not have corresponding tags on the right

View Source
const UnlessType = "unless"

UnlessType uses all values from lhs which do not exist in rhs

Variables

This section is empty.

Functions

func DedupeMetadata added in v0.4.1

func DedupeMetadata(
	seriesMeta []block.SeriesMeta,
) (models.Tags, []block.SeriesMeta)

DedupeMetadata applies all shared tags from Metadata to each SeriesMeta

func FlattenMetadata added in v0.4.1

func FlattenMetadata(
	meta block.Metadata,
	seriesMeta []block.SeriesMeta,
) []block.SeriesMeta

FlattenMetadata applies all shared tags from Metadata to each SeriesMeta

func HashFunc added in v0.4.1

func HashFunc(on bool, names ...string) func(models.Tags) uint64

HashFunc returns a function that calculates the signature for a metric ignoring the provided labels. If on, then the given labels are only used instead.

func NewLogicalOp added in v0.4.1

func NewLogicalOp(
	opType string,
	lNode parser.NodeID,
	rNode parser.NodeID,
	matching *VectorMatching,
) (parser.Params, error)

NewLogicalOp creates a new logical operation

Types

type VectorMatchCardinality

type VectorMatchCardinality int

VectorMatchCardinality describes the cardinality relationship of two Vectors in a binary operation.

const (
	// CardOneToOne is used for one-one relationship
	CardOneToOne VectorMatchCardinality = iota
	// CardManyToOne is used for many-one relationship
	CardManyToOne
	// CardOneToMany is used for one-many relationship
	CardOneToMany
	// CardManyToMany is used for many-many relationship
	CardManyToMany
)

type VectorMatching

type VectorMatching struct {
	// The cardinality of the two Vectors.
	Card VectorMatchCardinality
	// MatchingLabels contains the labels which define equality of a pair of
	// elements from the Vectors.
	MatchingLabels []string
	// On includes the given label names from matching,
	// rather than excluding them.
	On bool
	// Include contains additional labels that should be included in
	// the result from the side with the lower cardinality.
	Include []string
}

VectorMatching describes how elements from two Vectors in a binary operation are supposed to be matched.

Jump to

Keyboard shortcuts

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