Fix Service Ping manage events monthly metric
What does this MR do and why?
Within !73670 (merged) metric usage_activity_by_stage_monthly.manage.events
was modified to use dedicated start
and finish
queries that was able to utilize dedicated index. However for finish
query order wasn't set properly resulting in wrong range being analyzed.
Finish query plan: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7145/commands/25316
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
While in rails console sessions:
# seed some data
User.take(4).each { |user| Event.create(author: user, action: "closed", target_type: "Issue", created_at: 3.days.ago, updated_at: 3.days.ago) }
# stub batch size in underlying counter
Gitlab::Database::PostgresHll::BatchDistinctCounter::MIN_REQUIRED_BATCH_SIZE = 0
Gitlab::Database::PostgresHll::BatchDistinctCounter::DEFAULT_BATCH_SIZE = 1
# get metric data, prior to fix it would return value close to 1
# after fix the value should be around 4 or more (if you had more pre existing data in your local db)
Gitlab::UsageData.send(:stage_manage_events, Gitlab::UsageData.monthly_time_range_db_params)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
assigned to @mikolaj_wawrzyniak
- A deleted user
added product intelligencereview pending label
2 Warnings Please add a merge request type to this merge request. This merge request does not refer to an existing milestone. Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Pedro Pombeiro ( @pedropombeiro
) (UTC+1, same timezone as@mikolaj_wawrzyniak
)Douglas Barbosa Alexandre ( @dbalexandre
) (UTC-3, 4 hours behind@mikolaj_wawrzyniak
)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger- Resolved by Sean McGivern
@mcelicalderonG can I ask you for a backend review please
requested review from @mcelicalderonG
- Resolved by Rajendra Kadam
@rkadam3 can you please take a look form product intelligence perspective
added workflowin review label
requested review from @rkadam3
removed review request for @rkadam3
@rkadam3
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.
For more info, please refer to the following links:
added product intelligenceapproved label and removed product intelligencereview pending label
requested review from @smcgivern and removed review request for @mcelicalderonG
added pipeline:skip-undercoverage label
enabled an automatic merge when the pipeline for 7c9015f7 succeeds
mentioned in commit cda4483b
added workflowstaging-canary label and removed workflowin review label
added workflowstaging label and removed workflowstaging-canary label
added workflowcanary label and removed workflowstaging label
added workflowproduction label and removed workflowcanary label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!474 (merged)