Improve batch counting performance for last 28 days
requested to merge 251048-modify-time-period-for-batch-counting-performance-of-the-last-portion-of-the-loops into master
What does this MR do?
Change the definition of time_period
for last 28 days to improve batch counting performance of the last portion of the loops
- When we change the definition for last 28 days to
2 days
back, we may skip concurrency issues and database locks - This may avoid time outs in the last portion of a table for 28 day counters
- This may also improve the calculation time and performance overall
This should be ok from a product analytics or Data point of view:
- Pings arrive at weekly random days and hours for each self-managed instance
- There's a delay in when we see the usage ping in dashboards
Issue #251048 (closed)
def last_28_days_time_period(column: :created_at)
- { column => 28.days.ago..Time.current }
+ { column => 30.days.ago..2.days.ago }
end
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Alper Akgun