Skip to content

Improve batch counting performance for last 28 days

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

Availability and Testing

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

Merge request reports