interpolated_rate()

    1. SELECT
    2. id,
    3. bucket,
    4. interpolated_rate(
    5. summary,
    6. bucket,
    7. '15 min',
    8. LAG(summary) OVER (PARTITION BY id ORDER by bucket),
    9. LEAD(summary) OVER (PARTITION BY id ORDER by bucket)
    10. )
    11. SELECT
    12. id,
    13. time_bucket('15 min'::interval, ts) AS bucket,
    14. counter_agg(ts, val) AS summary
    15. FROM foo
    16. GROUP BY id, time_bucket('15 min'::interval, ts)
    17. ) t