integral() function

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

The integral() function computes the area under the curve per unit of time of subsequent non-null records. The curve is defined using _time as the domain and record values as the range.

Function type: Aggregate
Output data type: Float

integral(unit: 10s, column: "_value")

Parameters

unit

The time duration used when computing the integral.

Data type: Duration

column

The column on which to operate. Defaults to "_value".

Data type: String

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> filter(fn: (r) =>
    r._measurement == "cpu" and
    r._field == "usage_system"
  )
  |> integral(unit:10s)

INTEGRAL()