rate()
The rate of change of the counter over the observed time period. This is the raw or simple rate, equivalent to delta(summary)
or time_delta(summary)
. After accounting for resets, the last value is subtracted from the first value and divided by the duration between the last observed time and the first observed time.
rate(
summary CounterSummary
) 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 |
---|---|---|
rate | DOUBLE PRECISION | The per second observed rate computed from the CounterSummary |
Sample usage
SELECT
id,
rate(summary)
FROM (
SELECT
id,
counter_agg(ts, val) AS summary
FROM foo
GROUP BY id
) t
当前内容版权归 TimescaleDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 TimescaleDB .