package mapping
import "go.opentelemetry.io/otel/sdk/metric/aggregator/exponential/mapping"
Index ¶
Variables ¶
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") )
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.
Source Files ¶
mapping.go
Directories ¶
Path | Synopsis |
---|---|
aggregator/exponential/mapping/exponent | |
aggregator/exponential/mapping/logarithm |
- Version
- v0.31.0
- Published
- Jul 8, 2022
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 1 hour ago –
Tools for package owners.