feat: add API to get latest outages (WIP)#72
feat: add API to get latest outages (WIP)#72thomas-barthelemy wants to merge 1 commit intoiloire:masterfrom
Conversation
| /** | ||
| * Get latest service outages. | ||
| */ | ||
|
|
There was a problem hiding this comment.
This is a reporting route, accesible to all users with permissions to view this service. I think it belongs to api-report-route.js
|
Thanks a lot for the contribution Thomas! About point number 4, having the service name and ID would be great. Grouping by service could be a great idea... maybe that could be determined by a query parameter (default grouping=off). Number 5: yes, that would be the whole point. Number 6: this repo ships with the built assets so you can run it out of the box if you want. Number 7: assertions to prove the main structure for outages should be fine. Number 8: yes, performance may be a concern if there are hundreds of services and hundreds of outages :) Some rough numbers on the current performance will the proposed solution would be great. |
6db58c6 to
692bc23
Compare
|
Thanks for the answers, that helped clarify a bit more what we were going for with this.
for 7, my point was more that for 8 I will run some numbers after remaining todos, definitely curious to see how that multi is doing. |
692bc23 to
7a39fd7
Compare
|
Add tests and impl grouping. Some numbers for 100 services, 10 outages/service on average:
overall it's pretty consistent in performance with other APIs. |
Still a WIP but a fair taste of what I have in mind regarding #36.
Little considerations to discuss out of that issue:
LIMITparameter defaults to10SINCEparameter defaults to1 hour ago/api/services/outagesservicefield to each representing the service id. I also considered grouping result by service id instead./public/build/), will add when/if need be. What's their use right now in the repository?test-report.js, might wanna avoid duplicating those as it will be needed aroundmax-itemsoutages for each requested service with aMulti, then sorting and slicing the result.