Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cbf35906
Commit
cbf35906
authored
Sep 17, 2019
by
Pavel Shutsin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schedule productivity analytics backfill
parent
3110845a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
changelogs/unreleased/backport-schedule-productivity-analytics-backfill.yml
...sed/backport-schedule-productivity-analytics-backfill.yml
+5
-0
db/post_migrate/20190724091326_schedule_productivity_analytics_backfill.rb
...0190724091326_schedule_productivity_analytics_backfill.rb
+31
-0
No files found.
changelogs/unreleased/backport-schedule-productivity-analytics-backfill.yml
0 → 100644
View file @
cbf35906
---
title
:
Schedule productivity analytics recalculation for EE
merge_request
:
15137
author
:
type
:
other
db/post_migrate/20190724091326_schedule_productivity_analytics_backfill.rb
0 → 100644
View file @
cbf35906
# frozen_string_literal: true
class
ScheduleProductivityAnalyticsBackfill
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
BATCH_SIZE
=
10_000
INTERVAL
=
3
.
minutes
MIGRATION
=
'Gitlab::BackgroundMigration::RecalculateProductivityAnalytics'
.
freeze
disable_ddl_transaction!
def
up
return
unless
Gitlab
.
ee?
metrics_model
=
Class
.
new
(
ActiveRecord
::
Base
)
do
self
.
table_name
=
'merge_request_metrics'
include
::
EachBatch
end
scope
=
metrics_model
.
where
(
"merged_at >= ?"
,
3
.
months
.
ago
)
queue_background_migration_jobs_by_range_at_intervals
(
scope
,
MIGRATION
,
INTERVAL
,
batch_size:
BATCH_SIZE
)
end
def
down
# no-op
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment