aggregator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidQuantile  = fmt.Errorf("The requested quantile is out of range")
	ErrNegativeInput    = fmt.Errorf("Negative value is out of range for this instrument")
	ErrNaNInput         = fmt.Errorf("NaN value is an invalid input")
	ErrNonMonotoneInput = fmt.Errorf("The new value is not monotone")
	ErrInconsistentType = fmt.Errorf("Inconsistent aggregator types")

	// ErrNoLastValue is returned by the LastValue interface when
	// (due to a race with collection) the Aggregator is
	// checkpointed before the first value is set.  The aggregator
	// should simply be skipped in this case.
	ErrNoLastValue = fmt.Errorf("No value has been set")

	// ErrEmptyDataSet is returned by Max and Quantile interfaces
	// when (due to a race with collection) the Aggregator is
	// checkpointed before the first value is set.  The aggregator
	// should simply be skipped in this case.
	ErrEmptyDataSet = fmt.Errorf("The result is not defined on an empty data set")
)

Functions

func NewInconsistentMergeError

func NewInconsistentMergeError(a1, a2 export.Aggregator) error

NewInconsistentMergeError formats an error describing an attempt to merge different-type aggregators. The result can be unwrapped as an ErrInconsistentType.

func RangeTest

func RangeTest(number core.Number, descriptor *export.Descriptor) error

RangeTest is a commmon routine for testing for valid input values. This rejects NaN values. This rejects negative values when the metric instrument does not support negative values, including monotonic counter metrics and absolute measure metrics.

Types

type Count

type Count interface {
	Count() (int64, error)
}

Sum returns the number of values that were aggregated.

type Distribution

type Distribution interface {
	MaxSumCount
	Quantile
}

MaxSumCount supports the Max, Sum, Count, and Quantile interfaces.

type LastValue

type LastValue interface {
	LastValue() (core.Number, time.Time, error)
}

LastValue returns the latest value that was aggregated.

type Max

type Max interface {
	Max() (core.Number, error)
}

Max returns the maximum value over the set of values that were aggregated.

type MaxSumCount

type MaxSumCount interface {
	Sum
	Count
	Max
}

MaxSumCount supports the Max, Sum, and Count interfaces.

type Quantile

type Quantile interface {
	Quantile(float64) (core.Number, error)
}

Quantile returns an exact or estimated quantile over the set of values that were aggregated.

type Sum

type Sum interface {
	Sum() (core.Number, error)
}

Sum returns an aggregated sum.

Jump to

Keyboard shortcuts

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