GaugeSummary that can be used to accumulate gauge data for further
gauge_agg ( ts TIMESTAMPTZ, value DOUBLE PRECISION ) RETURNS GaugeSummary
For more information about counter and gauge aggregation functions, see the hyperfunctions documentation.
|The time at each point|
|The value at that timestamp|
DOUBLE PRECISION values are accepted for the
value parameter. For gauge
data stored as other numeric types, cast it to
DOUBLE PRECISION when using the
NULLvalues in your data, the aggregate ignores them. At least some of the values must be non-
NULL. Otherwise, you get an error.
|The largest and smallest possible times that can be input to the aggregate. Calling with |
GaugeSummarycan be used as an input the accessor functions
idelta_right. When this feature is mature, it will support all the same accessor functions as
CounterSummary, with the exception of
Create a gauge summary from time-series data that has a timestamp,
ts, and a
val. Get the instantaneous rate of change from the last 2 time
intervals using the
WITH t as ( SELECT time_bucket('1 day'::interval, ts) as dt, gauge_agg(ts, val) AS gs FROM foo WHERE id = 'bar' GROUP BY time_bucket('1 day'::interval, ts) ) SELECT dt, irate_right(gs) FROM t;
Found an issue on this page?Report an issue!