mapping

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnderflow is returned when computing the lower boundary
	// of an index that maps into a denormalized floating point value.
	ErrUnderflow = fmt.Errorf("underflow")
	// ErrOverflow is returned when computing the lower boundary
	// of an index that maps into +Inf.
	ErrOverflow = fmt.Errorf("overflow")
)

Functions

This section is empty.

Types

type Mapping

type Mapping interface {
	// MapToIndex maps positive floating point values to indexes
	// corresponding to Scale().  Implementations are not expected
	// to handle zeros, +Inf, NaN, or negative values.
	MapToIndex(value float64) int32

	// LowerBoundary returns the lower boundary of a given bucket
	// index.  The index is expected to map onto a range that is
	// at least partially inside the range of normalized floating
	// point values.  If the corresponding bucket's upper boundary
	// is less than or equal to 0x1p-1022, ErrUnderflow will be
	// returned.  If the corresponding bucket's lower boundary is
	// greater than math.MaxFloat64, ErrOverflow will be returned.
	LowerBoundary(index int32) (float64, error)

	// Scale returns the parameter that controls the resolution of
	// this mapping.  For details see:
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/datamodel.md#exponential-scale
	Scale() int32
}

Mapping is the interface of an exponential histogram mapper.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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