utils

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: Apache-2.0 Imports: 4 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DedupeMetadata

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

DedupeMetadata applies all shared tags from Metadata to each SeriesMeta

func FlattenMetadata

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

FlattenMetadata applies all shared tags from Metadata to each SeriesMeta

func FormatFloat added in v0.4.3

func FormatFloat(
	value float64,
) string

FormatFloat applies all shared tags from Metadata to each SeriesMeta

func GroupSeries

func GroupSeries(
	matchingTags []string,
	without bool,
	opName string,
	metas []block.SeriesMeta,
) ([][]int, []block.SeriesMeta)

GroupSeries groups series by tags. It gives a list of seriesMeta for the grouped series, and a list of corresponding buckets which signify which series are mapped to which grouped outputs

Types

type FloatHeap added in v0.4.3

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

FloatHeap is a heap that can be given a maximum size

func NewFloatHeap added in v0.4.3

func NewFloatHeap(isMaxHeap bool, capacity int) FloatHeap

NewFloatHeap builds a new FloatHeap based on first parameter and a capacity given by second parameter. Zero and negative values for maxSize provide an unbounded FloatHeap

func (FloatHeap) Cap added in v0.4.3

func (fh FloatHeap) Cap() int

Cap returns the capacity of the heap

func (FloatHeap) Flush added in v0.4.3

func (fh FloatHeap) Flush() []ValueIndexPair

Flush flushes the float heap and resets it. Does not guarantee order.

func (FloatHeap) Len added in v0.4.3

func (fh FloatHeap) Len() int

Len returns the current length of the heap

func (FloatHeap) Peek added in v0.4.3

func (fh FloatHeap) Peek() (ValueIndexPair, bool)

Peek reveals the top value of the heap without mutating the heap.

func (FloatHeap) Push added in v0.4.3

func (fh FloatHeap) Push(value float64, index int)

Push pushes a value and index pair to the heap

func (*FloatHeap) Reset added in v0.4.3

func (fh *FloatHeap) Reset()

Reset resets the heap

type ValueIndexPair added in v0.4.3

type ValueIndexPair struct {
	Val   float64
	Index int
}

ValueIndexPair is a pair of float value and index at which it exists

Jump to

Keyboard shortcuts

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