-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: Logs the duration of migrations execution #29893
chore: Logs the duration of migrations execution #29893
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #29893 +/- ##
===========================================
+ Coverage 60.48% 83.69% +23.20%
===========================================
Files 1931 527 -1404
Lines 76236 38041 -38195
Branches 8568 0 -8568
===========================================
- Hits 46114 31839 -14275
+ Misses 28017 6202 -21815
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor nitpicks
e6b2122
to
8fe12f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] a context decorator could be nice and simple for this:
with print_duration(label=f"Migration: {migration_id}"):
do_stuff()
Wondering if just using event_logger.log_context(action='migration')
would just work (in CI, the logging should be utils.log.StdOutEventLogger
, though it doesn't seem to be the default)
That would be nice. We can think about this when creating the helper functions for the migrations as part of [SIP-142] Improving Database Migration Management |
(cherry picked from commit 57a4199)
SUMMARY
Depending on the amount of data an organization has, the migration scripts can take a long time to run. This PR adds the duration of the complete migration process to help administrators to estimate downtime for upgrades/downgrades. Duration is only logged in case all migrations successfully complete.
TESTING INSTRUCTIONS
CI should be sufficient.
ADDITIONAL INFORMATION