Samples
Given a table calledliveness containing weekly heartbeat aggregates in column health with timestamp column date,
use the following to get the intervals where the system was down during the week of Jan 9, 2022.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the down intervals from a heartbeat_agg
liveness containing weekly heartbeat aggregates in column health with timestamp column date,
use the following to get the intervals where the system was down during the week of Jan 9, 2022.
SELECT dead_ranges(health)
FROM liveness
WHERE date = '01-9-2022 UTC'
dead_ranges
-----------------------------------------------------
("2022-01-09 00:00:00+00","2022-01-09 00:00:30+00")
("2022-01-12 15:27:22+00","2022-01-12 15:31:17+00")
dead_ranges(
agg HEARTBEATAGG
) RETURNS TABLE (
start TIMESTAMPTZ,
end TIMESTAMPTZ
)
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| agg | HeartbeatAgg | - | ✔ | A heartbeat aggregate to get the liveness data from |
| Column | Type | Description |
|---|---|---|
| dead_ranges | TABLE (start TIMESTAMPTZ, end TIMESTAMPTZ) | The (start, end) pairs of when the system was down. |