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

Performance tweak statements #1145

Merged
merged 10 commits into from
Mar 17, 2023
Merged

Conversation

seeker25
Copy link
Collaborator

Description of changes:
Performance tweak statements

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the sbc-pay license (Apache 2.0).

@github-advanced-security
Copy link
Contributor

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@seeker25 seeker25 added the bug Something isn't working label Mar 17, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #1145 (3da796a) into main (28ff797) will decrease coverage by 11.33%.
The diff coverage is 90.40%.

@@             Coverage Diff             @@
##             main    #1145       +/-   ##
===========================================
- Coverage   91.54%   80.22%   -11.33%     
===========================================
  Files         153       21      -132     
  Lines        9842     1623     -8219     
===========================================
- Hits         9010     1302     -7708     
+ Misses        832      321      -511     
Flag Coverage Δ
eventlistenerqueue ?
payapi ?
paymentjobs 80.22% <90.40%> (+1.26%) ⬆️

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

Impacted Files Coverage Δ
jobs/payment-jobs/tasks/routing_slip_task.py 89.09% <0.00%> (-0.43%) ⬇️
jobs/payment-jobs/tasks/cfs_create_invoice_task.py 72.44% <50.00%> (-0.24%) ⬇️
jobs/payment-jobs/tasks/statement_task.py 80.43% <79.66%> (+9.46%) ⬆️
jobs/payment-jobs/tasks/common/cgi_ap.py 88.69% <88.67%> (-2.10%) ⬇️
jobs/payment-jobs/tasks/ap_task.py 96.03% <96.03%> (ø)
...ayment-jobs/tasks/bcol_refund_confirmation_task.py 73.58% <100.00%> (+1.03%) ⬆️
jobs/payment-jobs/tasks/common/dataclasses.py 100.00% <100.00%> (ø)
...ent-jobs/tasks/direct_pay_automated_refund_task.py 86.04% <100.00%> (-0.48%) ⬇️
jobs/payment-jobs/tasks/distribution_task.py 97.75% <100.00%> (+0.05%) ⬆️
...ayment-jobs/tasks/ejv_partner_distribution_task.py 99.13% <100.00%> (ø)

... and 132 files with indirect coverage changes

@seeker25
Copy link
Collaborator Author

seeker25 commented Mar 17, 2023

Takes the job in prod 6 minutes to run for a weekly run now (could be up to an hour before):

----------------------------Scheduler Ran With Argument-- GENERATE_STATEMENTS
2023-03-17 17:26:59,847 - invoke_jobs - INFO in invoke_jobs:invoke_jobs.py:50 - create_app: <<<< Starting Payment Jobs >>>>
2023-03-17 17:27:00,210 - invoke_jobs - DEBUG in statement_task:statement_task.py:48 - generate_statements: Generating statements for: 2023-02-11 using date override.
2023-03-17 17:27:00,246 - invoke_jobs - DEBUG in statement_task:statement_task.py:70 - _generate_daily_statements: Found 45 accounts to generate DAILY statements
2023-03-17 17:27:00,246 - invoke_jobs - DEBUG in statement_task:statement_task.py:121 - _create_statement_records: Statements for day: 2023-02-11
2023-03-17 17:27:01,844 - invoke_jobs - DEBUG in statement_task:statement_task.py:169 - _clean_up_old_statements: Removing 0 existing duplicate/stale statements.
2023-03-17 17:27:01,852 - invoke_jobs - DEBUG in statement_task:statement_task.py:133 - _create_statement_records: Inserting statements.
2023-03-17 17:27:01,901 - invoke_jobs - DEBUG in statement_task:statement_task.py:149 - _create_statement_records: Inserting statement invoices.
2023-03-17 17:27:06,448 - invoke_jobs - DEBUG in statement_task:statement_task.py:85 - _generate_weekly_statements: Found 27042 accounts to generate WEEKLY statements
2023-03-17 17:27:06,449 - invoke_jobs - DEBUG in statement_task:statement_task.py:123 - _create_statement_records: Statements for week: 2023-02-05 to 2023-02-11
2023-03-17 17:27:19,403 - invoke_jobs - DEBUG in statement_task:statement_task.py:169 - _clean_up_old_statements: Removing 4 existing duplicate/stale statements.
2023-03-17 17:27:19,416 - invoke_jobs - DEBUG in statement_task:statement_task.py:133 - _create_statement_records: Inserting statements.
2023-03-17 17:27:48,860 - invoke_jobs - DEBUG in statement_task:statement_task.py:149 - _create_statement_records: Inserting statement invoices.
2023-03-17 17:33:40,550 - invoke_jobs - INFO in invoke_jobs:invoke_jobs.py:99 - run: <<<< Completed Generating Statements >>>>

@seeker25 seeker25 marked this pull request as ready for review March 17, 2023 17:27
@seeker25 seeker25 merged commit d890ce1 into bcgov:main Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants