increase() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.24 is the most recent stable version of Flux.

The increase() function calculates the total non-negative difference between values in a table. A main use case is tracking changes in counter values which may wrap over time when they hit a threshold or are reset. In the case of a wrap/reset, the function assumes the absolute delta between two points is at least their non-negative difference.

Function type: Aggregate
Output data type: Float

increase(columns: ["_values"])

Parameters

columns

The list of columns for which the increase is calculated. Defaults to ["_value"].

Data type: Array of strings

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -24h)
  |> filter(fn: (r) => r._measurement == "system" AND r._field == "n_users")
  |> increase()

Function definition

increase = (tables=<-, columns=["_value"]) =>
	tables
		|> difference(nonNegative: true, columns:columns)
		|> cumulativeSum()