Versions:
num_resets() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Toolkit
TimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
The total number of times the counter is reset while calculating the CounterSummary.
num_resets(
summary CounterSummary
) RETURNS BIGINT
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 |
---|---|---|
num_resets | BIGINT | The number of resets detected during the counter_agg call |
Sample usage
SELECT
id,
bucket,
num_resets(summary)
FROM (
SELECT
id,
time_bucket('15 min'::interval, ts) AS bucket,
counter_agg(ts, val) AS summary
FROM foo
GROUP BY id, time_bucket('15 min'::interval, ts)
) t
Found an issue on this page?
Report an issue!