OneNoughtOne
0/308
Loading content...
A reliability platform stores daily service health outcomes in two tables.
Tables:
Column details:
Reporting window:
Guarantee within the reporting window:
Task:
Output requirements:
Supported submission environments:
outages:
| down_date |
|-------------|
| 2019-12-30 |
| 2020-01-04 |
| 2020-01-05 |
recoveries:
| up_date |
|-------------|
| 2019-12-31 |
| 2020-01-01 |
| 2020-01-02 |
| 2020-01-03 |
| 2020-01-06 |[
{"period_state":"healthy","start_date":"2020-01-01","end_date":"2020-01-03"},
{"period_state":"outage","start_date":"2020-01-04","end_date":"2020-01-05"},
{"period_state":"healthy","start_date":"2020-01-06","end_date":"2020-01-06"}
]Explanation
Rows from 2019 are ignored. Inside the reporting window, days are grouped into maximal same-state streaks.
outages:
| down_date |
|-------------|
| 2020-02-29 |
recoveries:
| up_date |
|-------------|
| 2020-02-28 |
| 2020-03-01 |[
{"period_state":"healthy","start_date":"2020-02-28","end_date":"2020-02-28"},
{"period_state":"outage","start_date":"2020-02-29","end_date":"2020-02-29"},
{"period_state":"healthy","start_date":"2020-03-01","end_date":"2020-03-01"}
]Explanation
Leap day is treated like any normal calendar day. Status flips create separate intervals.
outages:
| down_date |
|-------------|
| 2020-04-10 |
| 2020-04-11 |
| 2020-04-12 |
recoveries:
| up_date |
|-------------|
| 2020-04-01 |
| 2020-04-02 |
| 2020-04-03 |
| 2020-04-04 |
| 2020-04-05 |
| 2020-04-06 |
| 2020-04-07 |
| 2020-04-08 |
| 2020-04-09 |
| 2020-04-13 |
| 2020-04-14 |[
{"period_state":"healthy","start_date":"2020-04-01","end_date":"2020-04-09"},
{"period_state":"outage","start_date":"2020-04-10","end_date":"2020-04-12"},
{"period_state":"healthy","start_date":"2020-04-13","end_date":"2020-04-14"}
]Explanation
Three consecutive outage days form one outage interval between two healthy intervals.
Constraints