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.

  1. delta(
  2. summary CounterSummary
  3. ) RETURNS DOUBLE PRECISION

For more information about counter aggregation functions, see the hyperfunctions documentation.

Required arguments

NameTypeDescription
summaryCounterSummaryThe input CounterSummary from a counter_agg call

Returns

NameTypeDescription
deltaDOUBLE PRECISIONThe delta computed from the CounterSummary

Sample usage

  1. SELECT
  2. id,
  3. delta(summary)
  4. FROM (
  5. SELECT
  6. id,
  7. counter_agg(ts, val) AS summary
  8. FROM foo
  9. GROUP BY id
  10. ) t