Integral functions
You can use integrals to find the area under the curve per unit of time for your time series events. As an example, suppose you're tracking the volume of requests received by your application per unit of time. In this scenario, you can use the integral function to determine the total volume of requests served per specified interval over a specific time period.
Amazon Timestream supports one variant of integral functions. This section provides usage information for the Timestream for LiveAnalytics integral function, as well as sample queries.
Usage information
Function | Output data type | Description |
---|---|---|
|
double |
Approximates the integral |
Query examples
Calculate the total volume of requests served per five minutes over the past hour by a specific host:
SELECT INTEGRAL_TRAPEZOIDAL(CREATE_TIME_SERIES(time, measure_value::double), 5m) AS result FROM sample.DevOps WHERE measure_name = 'request' AND hostname = 'host-Hovjv' AND time > ago (1h) GROUP BY hostname, measure_name