distribution

package
v1.300065.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedWeight = errors.New("weight must be larger than 0")
	ErrUnsupportedValue  = errors.New("value cannot be negative, NaN, Inf, or greater than 2^360")
	MinValue             = -math.Pow(2, 360)
	MaxValue             = math.Pow(2, 360)
)
View Source
var NewClassicDistribution func() ClassicDistribution

Functions

func IsSupportedValue added in v1.300028.1

func IsSupportedValue(value, min, max float64) bool

IsSupportedValue checks to see if the metric is between the min value and 2^360 and not a NaN. This matches the accepted range described in the MetricDatum documentation https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html

Types

type ClassicDistribution added in v1.300060.0

type ClassicDistribution interface {
	Distribution
	ConvertToOtel(dp pmetric.HistogramDataPoint)

	ConvertFromOtel(dp pmetric.HistogramDataPoint, unit string)
}

type Distribution

type Distribution interface {
	Maximum() float64

	Minimum() float64

	SampleCount() float64

	Sum() float64

	ValuesAndCounts() ([]float64, []float64)

	Unit() string

	Size() int

	// weight is 1/samplingRate
	AddEntryWithUnit(value float64, weight float64, unit string) error

	// weight is 1/samplingRate
	AddEntry(value float64, weight float64) error

	AddDistribution(Distribution)
	Resize(int) []Distribution
}

type ExponentialDistribution added in v1.300060.0

type ExponentialDistribution interface {
	Distribution

	ConvertFromOtel(dp pmetric.ExponentialHistogramDataPoint, unit string)
}

Directories

Path Synopsis
The following functions are originally sourced from OpenTelemetry's reference implementation.
The following functions are originally sourced from OpenTelemetry's reference implementation.

Jump to

Keyboard shortcuts

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