time_delta()
For more information about counter aggregation functions, see the hyperfunctions documentation.
Name | Type | Description |
---|---|---|
time_delta | DOUBLE PRECISION | The total duration in seconds between the first and last observed times in the CounterSummary |
SELECT
id,
time_delta(summary)
FROM (
SELECT
id,
time_bucket('15 min'::interval, ts) AS bucket,
counter_agg(ts, val) AS summary
FROM foo
GROUP BY id, time_bucket('15 min'::interval, ts)