Samples
Given a table calledliveness containing weekly heartbeat aggregates in column health with timestamp column date,
use the following to see if the system was live at a particular time.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Test if the aggregate has a heartbeat covering a given time
liveness containing weekly heartbeat aggregates in column health with timestamp column date,
use the following to see if the system was live at a particular time.
SELECT live_at(health, '2022-01-12 15:30:00+00')
FROM liveness
WHERE date = '01-9-2022 UTC'
live_at
---------
f
live_at(
agg HEARTBEATAGG,
test TIMESTAMPTZ
) RETURNS BOOL
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| agg | HeartbeatAgg | - | ✔ | A heartbeat aggregate to get the liveness data from |
| test | TimestampTz | - | ✔ | The time to test the liveness of |
| Column | Type | Description |
|---|---|---|
| live_at | bool | True if the heartbeat aggregate had a heartbeat close before the test time. |