The-Academic-Observatory / oaebu-workflows

Telescopes, Workflows and Data Services for the 'Book Analytics Dashboard Project (2022-2025)', building upon the project 'Developing a Pilot Data Trust for Open Access eBook Usage (2020-2022)'
https://documentation.book-analytics.org/
Apache License 2.0
5 stars 0 forks source link

INF-604: Crossref pools for the ONIX workflow #137

Closed keegansmith21 closed 1 year ago

keegansmith21 commented 1 year ago

This PR creates a pool for each of the crossref (metadata and event) APIs used by the ONIX workflow. This is necessary because many of the workflows can run at once, each of which will throttle themselves without knowledge of outside tasks.

The pool sizes were chosen based only on my experimentation. The slots that each task take up will be equal to the number of threads used for each process, thereby effectively limiting the total number of active threads across all tasks using the same pool.

Tested locally and appears to work as intended. Although it's difficult because running 5 tasks at once tanks my computer.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (85bb867) 95.00% compared to head (7472443) 95.03%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #137 +/- ## =========================================== + Coverage 95.00% 95.03% +0.02% =========================================== Files 23 23 Lines 2685 2698 +13 Branches 351 351 =========================================== + Hits 2551 2564 +13 Misses 62 62 Partials 72 72 ``` | [Impacted Files](https://codecov.io/gh/The-Academic-Observatory/oaebu-workflows/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The-Academic-Observatory) | Coverage Δ | | |---|---|---| | [oaebu\_workflows/workflows/onix\_workflow.py](https://codecov.io/gh/The-Academic-Observatory/oaebu-workflows/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The-Academic-Observatory#diff-b2FlYnVfd29ya2Zsb3dzL3dvcmtmbG93cy9vbml4X3dvcmtmbG93LnB5) | `94.33% <100.00%> (+0.11%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The-Academic-Observatory). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The-Academic-Observatory)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.