Skip to content
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

Used a ThreadPoolExecutor to make concurrent API calls #1493

Merged
merged 3 commits into from
May 9, 2023
Merged

Conversation

arueth
Copy link
Collaborator

@arueth arueth commented May 4, 2023

Fixes #353

Background

Currently the fronted makes serial calls to the backend services, with this change it will make concurrent calls and therefore return the page quicker.

Change Summary

Change from serial to concurrent calls to the backend services.

Testing Procedure

Deploy the application in an environment and check the loading times for the home page.

My development environment is here: http://34.168.42.167/

Related PRs or Issues

None

@arueth arueth requested review from a team and yoshi-approver as code owners May 4, 2023 23:48
@arueth arueth enabled auto-merge (squash) May 4, 2023 23:48
@arueth arueth force-pushed the arueth-issue-353 branch 2 times, most recently from d0904d6 to 1cac436 Compare May 5, 2023 16:43
@bourgeoisor
Copy link
Member

@arueth looks like all checks are passing-- I tried out your live demo, it seems fairly snappy. Could you check Cloud Tracing and post a screenshot showing the calls happening in parallel? (see the description of #353 for the non-parallel screenshot)

@arueth
Copy link
Collaborator Author

arueth commented May 8, 2023

The trace doesn't seem to look like that anymore. I'm not sure if it the product of the change or a previous change.
Screenshot 2023-05-08 11 04 33 AM

@bourgeoisor
Copy link
Member

This is what I get on the current latest release (https://bank-of-anthos.xyz):
image

So it seems that's this PR's changes

@arueth
Copy link
Collaborator Author

arueth commented May 8, 2023

Using the threads must not play nice with the open telemetry plugin.

@arueth
Copy link
Collaborator Author

arueth commented May 9, 2023

I'm doing some refactoring to get the tracing working, expect an update shortly.

@arueth
Copy link
Collaborator Author

arueth commented May 9, 2023

Screenshot 2023-05-09 9 30 54 AM

becomes

Screenshot 2023-05-09 9 30 22 AM

Copy link
Member

@bourgeoisor bourgeoisor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@arueth arueth merged commit 2a9b4eb into main May 9, 2023
4 checks passed
@arueth arueth deleted the arueth-issue-353 branch May 9, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallelize frontend HTTP calls to backend APIs
2 participants