-
Notifications
You must be signed in to change notification settings - Fork 26
Make fewer requests in heartbeat, handle exceptions #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c60bd73 to
b998a0f
Compare
b998a0f to
9ae4a0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small questions, but definitely good to approve.
c7fce62 to
6b6098a
Compare
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
|
Thanks 🙏 Although, honestly, for a product that is used by so many companies in the world, 67 requests on an API should not even be considered an issue |
|
Tagged this issue as a "breaking change" since we renamed a field of the heartbeat payload |
This PR adjusts the heartbeat so that we make fewer requests in it.
Before, this PR we'd make
(n * 3) + 1API calls, wherenequals the number of configured projects:"all_projects_are_visible": - 1 API call"all_projects_have_permissions":nAPI calls (in a threadpool)"all_projects_components_exist":nAPI calls (not in a threadpool)"all_projects_issue_types_exist":nAPI calls (not in a threadpool)With 22 configured prod projects, that's 67 API calls (😱).
Now, we make n + 3 API calls:
"all_projects_are_visible": - 1 API call"all_projects_have_permissions": 1 API call"all_project_custom_components_exist"(renamed): up tonAPI calls (in a threadpool)"all_projects_issue_types_exist": 1 API callFor a grand total of
256 API calls in prod.(edit: we only make component requests for projects that specify custom components, and only 3 projects do that)
This was done by using different API endpoints (or params on those endpoints) to fetch more results at once. It's annoying that Jira doesn't provide an API endpoint to fetch components by project, but we were luckily able to make an improvement
This PR also adds a little more exception handling to functions we call in the heartbeat