Skip to main content
Since 1.3.0 Get the change in a counter over a time period. This is the simple delta, computed by subtracting the last seen value from the first, after accounting for resets.

Samples

Get the change in each counter over the entire time interval in table foo.
SELECT
    id,
    delta(summary)
FROM (
    SELECT
        id,
        counter_agg(ts, val) AS summary
    FROM foo
    GROUP BY id
) t

Arguments

The syntax is:
delta(
    summary CounterSummary
) RETURNS DOUBLE PRECISION
NameTypeDefaultRequiredDescription
summaryCounterSummary-A counter aggregated created using counter_agg

Returns

ColumnTypeDescription
deltaDOUBLE PRECISIONThe change in the counter over the bucketed interval