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

✨ Add profiling middleware to simcore services #5749

Conversation

bisgaard-itis
Copy link
Contributor

@bisgaard-itis bisgaard-itis commented Apr 26, 2024

What do these changes do?

  • Move existing profiling middleware from api-server to service_lib[fastapi]
  • Implement profiling middleware for aiohttp services.
  • Enable profiling middleware in debug mode (local deployment) and on master for the following services:
    • storage
    • webserver
    • catalog
    • dynamic-scheduler
    • director-v2
  • The following PR ensures will enable these features in master deployments: https://git.speag.com/oSparc/osparc-ops-deployment-configuration/-/merge_requests/567

Related issue/s

How to test

  1. run make build-devel && make up-devel
  2. In portainer, find the port on which storage is exposed.
  3. To profile the endpoint GET /v0/status in storage, run the following in bash:
curl -G 127.0.0.1:<storage port>/v0/status -H 'x-profile: true' | jq .profile -r

Here's an example of what that produces:
image

Dev-ops checklist

@bisgaard-itis bisgaard-itis self-assigned this Apr 26, 2024
@bisgaard-itis bisgaard-itis added a:storage issue related to storage service a:services-library issues on packages/service-libs a:apiserver api-server service labels Apr 26, 2024
@bisgaard-itis bisgaard-itis added this to the Enchanted Odyssey milestone Apr 26, 2024
Copy link

codecov bot commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 34.66667% with 49 lines in your changes are missing coverage. Please review.

Project coverage is 87.4%. Comparing base (cafbf96) to head (5b33d02).
Report is 170 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5749      +/-   ##
=========================================
+ Coverage    84.5%   87.4%    +2.8%     
=========================================
  Files          10    1366    +1356     
  Lines         214   56562   +56348     
  Branches       25    1285    +1260     
=========================================
+ Hits          181   49476   +49295     
- Misses         23    6812    +6789     
- Partials       10     274     +264     
Flag Coverage Δ
integrationtests 63.9% <66.6%> (?)
unittests 85.5% <34.6%> (+0.9%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...rvice-library/src/servicelib/mimetype_constants.py 100.0% <100.0%> (ø)
...er/src/simcore_service_api_server/core/settings.py 90.4% <100.0%> (ø)
...talog/src/simcore_service_catalog/core/settings.py 100.0% <100.0%> (ø)
...2/src/simcore_service_director_v2/core/settings.py 100.0% <100.0%> (ø)
...core_service_dynamic_scheduler/core/application.py 100.0% <100.0%> (ø)
...simcore_service_dynamic_scheduler/core/settings.py 100.0% <100.0%> (ø)
...storage/src/simcore_service_storage/application.py 83.9% <100.0%> (ø)
...es/storage/src/simcore_service_storage/settings.py 97.5% <100.0%> (ø)
...erver/src/simcore_service_webserver/application.py 98.1% <100.0%> (ø)
.../simcore_service_webserver/application_settings.py 98.2% <100.0%> (ø)
... and 7 more

... and 1327 files with indirect coverage changes

@bisgaard-itis bisgaard-itis changed the title ✨ Add profiling middleware to storage ✨ Add profiling middleware to simcore services Apr 27, 2024
@bisgaard-itis bisgaard-itis requested a review from wvangeit April 27, 2024 20:48
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

🥇

Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

Very nice, concise and readable.

services/docker-compose.devel.yml Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@bisgaard-itis bisgaard-itis enabled auto-merge (squash) May 2, 2024 06:57
@bisgaard-itis bisgaard-itis merged commit 398f6c2 into ITISFoundation:master May 2, 2024
55 checks passed
@bisgaard-itis bisgaard-itis deleted the 5729-add-profiling-middleware-to-storage branch May 2, 2024 07:15
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jun 12, 2024
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:apiserver api-server service a:services-library issues on packages/service-libs a:storage issue related to storage service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants