Timescale uses approximation algorithms to calculate a percentile without requiring all of the data. This also makes them more compatible with continuous aggregates.
By default, Timescale Toolkit uses
uddsketch, but you can also choose to use
tdigest. For more information about these algorithms, see the
advanced aggregation methods documentation.
In this procedure, we use an example table called
response_times that contains
information about how long a server takes to respond to API calls.
psqlprompt, create a continuous aggregate that computes the daily aggregates:
Re-aggregate the aggregate to get the last 30 days, and look for the ninety-fifth percentile:
You can also create an alert:
For more information about percentile approximation API calls, see the hyperfunction API documentation.
Found an issue on this page?Report an issue!