1.9 KiB
1.9 KiB
title | description | menu | weight | aliases | related | flux/v0.x/tags | introduced | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
experimental.integral() function | The `integral()` function computes the area under the curve per unit of time of subsequent non-null records. Input tables must have `_time` and `_value` columns. |
|
302 |
|
|
|
0.106.0 |
The experimental.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.
Input tables must have _time
and _value
columns.
integral()
is an aggregate function.
integral(
unit: 10s,
interpolate: "",
)
Parameters
unit
({{< req >}}) Time duration used to compute the integral.
interpolate
Type of interpolation to use.
Defaults to ""
.
Use one of the following interpolation options:
- empty string for no interpolation
- linear
tables
Input data.
Default is piped-forward data (<-
).
Examples
Calculate the integral
from(bucket: "example-bucket")
|> range(start: -5m)
|> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_system")
|> integral(unit: 10s)
Calculate the integral with linear interpolation
from(bucket: "example-bucket")
|> range(start: -5m)
|> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_system")
|> integral(unit: 10s, interpolate: "linear")