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
Click to show internal directories.
Click to hide internal directories.