Samples
Given a table calledliveness containing weekly heartbeat aggregates in column health with timestamp column date,
use this command to get the total interpolated downtime of the system 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 total time dead from a heartbeat aggregate and predecessor
liveness containing weekly heartbeat aggregates in column health with timestamp column date,
use this command to get the total interpolated downtime of the system during the week of Jan 9, 2022.
SELECT interpolated_downtime(
health,
LAG(health) OVER (ORDER BY date)
)
FROM liveness
WHERE date = '01-9-2022 UTC'
interpolated_downtime
---------------------
00:03:55
interpolated_downtime(
agg HEARTBEATAGG,
pred HEARTBEATAGG
) RETURNS INTERVAL
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| agg | HeartbeatAgg | - | ✔ | A heartbeat aggregate to get the liveness data from |
| pred | HeartbeatAgg | - | The heartbeat aggregate for the interval before the one being measured, if one exists |
| Column | Type | Description |
|---|---|---|
| interpolated_downtime | INTERVAL | The sum of all the unhealthy ranges in the aggregate, excluding those covered by the last heartbeat of the previous interval. |