// advent-of-postgres/day-24
The Launch Readiness Check
The last check before the big night: which services met their availability target this month, with planned maintenance left out.
It is 24 December. Before the sleigh takes off, Alabaster runs one last check: every service promised 99.95% availability for December, and only the services that kept the promise get to stay live tonight without an elf watching them.
Every service was checked once a minute from 1 to 23 December, in checks:
| Column | Type | Notes |
|---|---|---|
service |
text |
Part of the primary key |
checked_at |
timestamptz |
Every minute |
ok |
boolean |
false when it failed |
Some services had planned work, announced in advance, in planned_maintenance:
| Column | Type | Notes |
|---|---|---|
service |
text |
Which service |
window_ |
tstzrange |
[start, end): the end is not included |
A service's availability is the share of its checks that passed, leaving out the checks inside its own planned maintenance windows. A service meets the target when that share is 99.95% (0.9995) or more.
Your task
How many services met the 99.95% target?
Submit the number.
Stuck? Show a hint
Leave out every check that falls inside its own service's maintenance window (a range contains a timestamp with @>), then compare the share of ok checks with 0.9995.
Download today's data as SQL to solve it on your own Postgres (14 or later).
Solved this puzzle? Share it.
Tag @thedevopsdaily and share it with the community.
We earn commissions when you shop through the links below.
Bitrise
Managed runners for GitHub Actions
Bitrise Build Hub runs your GitHub Actions jobs on M4 Macs and AMD Linux machines. Change runs-on and keep your workflows, secrets and logs on GitHub.
Atomsized
AWS platform engineering and GitOps
Design and automation for reliable AWS and Kubernetes platforms, safer delivery workflows, and preview and UAT environments your engineers can understand and own.
DigitalOcean
Cloud infrastructure for developers
Simple, reliable cloud computing designed for developers
DevDojo
Developer community & tools
Join a community of developers sharing knowledge and tools
SMTPfast
Developer-first email API
Send transactional and marketing email through a clean REST API. Detailed logs, webhooks, and embeddable signup forms in one dashboard.
QuizAPI
Developer-first quiz platform
Build, generate, and embed quizzes with a powerful REST API. AI-powered question generation and live multiplayer.
Want to support DevOps Daily and reach thousands of developers?
Become a Sponsor