oncall-engine/engine/apps/api/serializers
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
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert.py Add alert detail view (#385) 2022-08-19 14:03:07 +05:00
alert_group.py Draft initial logic for user/schedule paging (#1098) 2023-01-17 12:19:08 -03:00
alert_receive_channel.py Hide direct paging integrations (#1162) 2023-01-20 13:29:57 +00:00
channel_filter.py Fix channel filter updates when there are multiple backends 2022-09-02 14:26:47 -03:00
custom_button.py Improve Jinja Template feedback and error handling (#884) 2022-11-28 09:46:51 -07:00
custom_serializers.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
escalation_chain.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
escalation_policy.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
integration_heartbeat.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
live_setting.py Allow no-auth SMTP connection for email notifications (#759) 2022-11-03 16:18:37 +00:00
on_call_shifts.py Web schedules overrides are the higher priority level (#1115) 2023-01-13 08:58:35 -03:00
organization.py remove grafana_plugin_management django app (#812) 2022-11-09 13:53:59 +01:00
organization_slack_settings.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
paging.py Add an ability to use an escalation chain for direct paging (#1161) 2023-01-19 18:51:57 +00:00
public_api_token.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
resolution_note.py Optimize alert group list view (#299) 2022-07-27 14:14:59 +03:00
schedule_base.py optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00
schedule_calendar.py centralize timezone validation + add serializer validation for on call shifts and schedules (#924) 2022-12-01 14:13:39 +01:00
schedule_ical.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
schedule_polymorphic.py Add select_related to fetch schedules user group information (#1109) 2023-01-09 13:15:27 -03:00
schedule_reminder.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
schedule_web.py centralize timezone validation + add serializer validation for on call shifts and schedules (#924) 2022-12-01 14:13:39 +01:00
slack_channel.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
slack_user_identity.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
team.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
telegram.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
user.py centralize timezone validation + add serializer validation for on call shifts and schedules (#924) 2022-12-01 14:13:39 +01:00
user_group.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
user_notification_policy.py World, meet OnCall! 2022-06-03 08:09:47 -06:00