awscsmmetrics

package
v1.247349.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZeroBucket = int64(-32768)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FrequencyMetric

type FrequencyMetric struct {
	Name        string
	Frequencies map[string]int64
}

FrequencyMetric represents a metric that is a numeric value.

func NewFrequencyMetric

func NewFrequencyMetric(name string) FrequencyMetric

NewFrequencyMetric will return a new metric with instantiated maps

func (*FrequencyMetric) CountSample

func (m *FrequencyMetric) CountSample(k string)

CountSample will add all frequencies in the metric. If rhs is nil, we will return immediately with no error. We will treat nil as zero count.

type FrequencyMetrics

type FrequencyMetrics map[string]FrequencyMetric

FrequencyMetrics is a collection of metrics

type Metric

type Metric interface {
	GetFrequencyMetrics() []FrequencyMetric
	GetSEHMetrics() []SEHMetric
	GetTimestamp() time.Time
	GetKeys() map[string]string
	GetSamples() []map[string]interface{}
}

Metric interface that is used to retrieve the necessary data to construct a PutRecord call to the voxdataplane service.

type SEHMetric

type SEHMetric struct {
	Name    string
	Stats   StatisticSet
	Buckets map[int64]float64
}

Type for a metric backed by a sparse exponential histogram (Seh) distribution

func NewSEHMetric

func NewSEHMetric(name string) SEHMetric

NewSEHMetric creates a new metric with an empty distribution

func (*SEHMetric) AddSample

func (m *SEHMetric) AddSample(value float64) error

AddSample will add a sample to an SEH metric. The zero bucket is specified to be -32768 which should not be hit by math.Log call.

func (*SEHMetric) AddWeightedSample

func (m *SEHMetric) AddWeightedSample(v float64, weight float64) error

type SEHMetrics

type SEHMetrics map[string]SEHMetric

SEHMetrics is a collection of metrics

type StatisticSet

type StatisticSet struct {
	SampleCount float64
	Sum         float64
	Min         float64
	Max         float64
}

func NewStatisticSet

func NewStatisticSet(value float64) StatisticSet

func NewWeightedStatisticSet

func NewWeightedStatisticSet(value float64, weight float64) StatisticSet

func (*StatisticSet) Merge

func (this *StatisticSet) Merge(other StatisticSet) error

Merges two statistic set distributions

Based on the following assumptions about IEEE fp math/representations:

(1) All finite floating point numbers are exactly one of == 0, < 0, or > 0
(2) Adding a (representable) positive number to a non-negative number results in a positive number

we can use a SampleCount of 0 as a marker for an empty distribution since we only allow the merging of non-negative sample counts

Directories

Path Synopsis
csm
Package csm provides the client and types for making API requests to Amazon Client-Side Monitoring.
Package csm provides the client and types for making API requests to Amazon Client-Side Monitoring.
csmiface
Package csmiface provides an interface to enable mocking the Amazon Client-Side Monitoring service client for testing your code.
Package csmiface provides an interface to enable mocking the Amazon Client-Side Monitoring service client for testing your code.
Package sdkmetricsdataplane provides the client and types for making API requests to AWS SDK Metrics Dataplane.
Package sdkmetricsdataplane provides the client and types for making API requests to AWS SDK Metrics Dataplane.
sdkmetricsdataplaneiface
Package sdkmetricsdataplaneiface provides an interface to enable mocking the AWS SDK Metrics Dataplane service client for testing your code.
Package sdkmetricsdataplaneiface provides an interface to enable mocking the AWS SDK Metrics Dataplane service client for testing your code.

Jump to

Keyboard shortcuts

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