rate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

type Calculator interface {
	// GetRate creates a gauge metric.
	// If this is the first time the name/attributes combination has been seen then the `valid` return value will be false.
	GetRate(name string, attributes map[string]interface{}, val float64, now time.Time) (gauge telemetry.Gauge, valid bool)

	// GetCumulativeRate creates a Gauge metric with rate of change based on the previous timestamp and value.
	// If no previous timestamp is NOT found, returns false (as no calculation is made)
	// If a previous timestamp is found use it to get the elapsed time (in seconds) and use that as the denominator
	// Rate = value / (now - before)[s]
	GetCumulativeRate(name string, attributes map[string]interface{}, val float64, now time.Time) (gauge telemetry.Gauge, valid bool)

	// Clean removes any data points that need to be cleaned up
	Clean()
}

func NewCalculator

func NewCalculator() Calculator

Jump to

Keyboard shortcuts

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