Skip to content

Latest commit

 

History

History
53 lines (52 loc) · 1.33 KB

delta.md

File metadata and controls

53 lines (52 loc) · 1.33 KB
api_name excerpt topics api hyperfunction api_details
delta()
Calculate the change in a counter from a counter aggregate
hyperfunctions
license type toolkit experimental version
community
function
true
false
experimental stable
0.2.0
1.3.0
family type aggregates
counters and gauges
accessor
counter_agg()
summary signatures parameters examples
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.
language code
sql
delta( summary CounterSummary ) RETURNS DOUBLE PRECISION
required returns
name type description
summary
CounterSummary
A counter aggregated created using [`counter_agg`](#counter_agg)
column type description
delta
DOUBLE PRECISION
The change in the counter over the bucketed interval
description command
Get the change in each counter over the entire time interval in table `foo`.
code
SELECT id, delta(summary) FROM ( SELECT id, counter_agg(ts, val) AS summary FROM foo GROUP BY id ) t