delta()

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.

2. delta(

4. summary CounterSummary

6. ) 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

2. SELECT

4. id,

6. delta(summary)

8. FROM (

10. SELECT

12. id,

14. counter_agg(ts, val) AS summary

16. FROM foo

18. GROUP BY id

20. ) t