oncall-engine/engine/apps/api
Joey Orlando 3cf2fcf660
optimize GET /schedules internal API endpoint (#1169)
# What this PR does

Fixes slow internal`GET /schedules` endpoints. Using the fake-data
generation script in #1128, I generated 65 calendar schedules in my
local setup. This resulted in the following endpoint performance:
![Screenshot 2023-01-24 at 12 03
16](https://user-images.githubusercontent.com/9406895/214276618-1a9848ba-eb84-49ec-a099-fdd96beac93f.png)

The responses which show ~76 queries were run on the latest `dev`
branch. Responses w/ ~26 queries were run on this branch.

Additionally:
- add typing to a few methods in `apps/schedules/ical_utils.py`
- document `apps/api/permissions/__init__.py:user_is_authorized`
function

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/1552

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2023-01-25 11:08:09 +01:00
..
permissions optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00
serializers optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00
tests Hide direct paging integrations (#1162) 2023-01-20 13:29:57 +00:00
throttlers World, meet OnCall! 2022-06-03 08:09:47 -06:00
views optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
response_renderers.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
urls.py Draft initial logic for user/schedule paging (#1098) 2023-01-17 12:19:08 -03:00