experimental.integral() function is subject to change at any time.
By using this function, you accept the risks of experimental functions.
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
integral() is an aggregate function.
integral( unit: 10s, interpolate: "", )
(Required) Time duration used to compute the integral.
Type of interpolation to use.
Use one of the following interpolation options:
- empty string for no interpolation
Default is piped-forward data (
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")
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.