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 logging to the licence-import import jobs #685

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-4024
https://eaflood.atlassian.net/browse/WATER-4039

This follows the same pattern used to get non-noisy logging included in the NALD import jobs.

Because the import process is run through jobs, it means for each company and licence to be imported, a 'job' is created. The legacy code would then log each time this happened. But when each entails creating approximately 70K jobs (140K in total!) the logs just become a sea of noise.

We implemented a pattern of including information in the job data about how many jobs in total there are, and what was the index of the current job when added to the queue. We can then use this information to log when the first job is started, and the last is completed.

In this way, we are only logging the start and end of the 'job' (even though there are thousands of them).

This change applies the same pattern to the licence-import company and licence-import jobs. We also do some tweaking to bring both NALD import and licence import in line.

https://eaflood.atlassian.net/browse/WATER-4024
https://eaflood.atlassian.net/browse/WATER-4039

This follows the same pattern used to get [non-noisy logging included in the NALD import jobs](#677).

Because the import process is run through jobs, it means for each company and licence to be imported, a 'job' is created. The legacy code would then log each time this happened. But when each entails creating approximately 70K jobs (140K in total!) the logs just become a sea of noise.

We implemented a pattern of including information in the job data about how many jobs in total there are, and what was the index of the current job when added to the queue. We can then use this information to get log when the first job is started, and the last is completed.

In this way we are only logging the start and end of the 'job' (even though there are thousands of them).

This change applies the same pattern to the licence-import company and licence import jobs. We also do some tweaking to bring both NALD import and licence import inline.
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Jul 7, 2023
@Cruikshanks Cruikshanks self-assigned this Jul 7, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review July 7, 2023 14:08
@Cruikshanks Cruikshanks merged commit 4ad8016 into main Jul 7, 2023
4 checks passed
@Cruikshanks Cruikshanks deleted the add-logging-import-companies branch July 7, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant