Versions:
delta() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Toolkit
TimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
The change in the counter over the time period. This is the raw or simple delta computed by accounting for resets and subtracting the last seen value from the first.
delta(
summary CounterSummary
) RETURNS DOUBLE PRECISION
For more information about counter aggregation functions, see the hyperfunctions documentation.
Required arguments
Name | Type | Description |
---|---|---|
summary | CounterSummary | The input CounterSummary from a counter_agg call |
Returns
Name | Type | Description |
---|---|---|
delta | DOUBLE PRECISION | The delta computed from the CounterSummary |
Sample usage
SELECT
id,
delta(summary)
FROM (
SELECT
id,
counter_agg(ts, val) AS summary
FROM foo
GROUP BY id
) t
Found an issue on this page?
Report an issue!