summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/cluster/puma_worker_killer_initializer.rb51
-rw-r--r--lib/gitlab/cluster/puma_worker_killer_observer.rb22
-rw-r--r--lib/gitlab/quick_actions/work_item_actions.rb3
-rw-r--r--lib/gitlab/usage_data_counters/known_events/product_analytics.yml2
4 files changed, 2 insertions, 76 deletions
diff --git a/lib/gitlab/cluster/puma_worker_killer_initializer.rb b/lib/gitlab/cluster/puma_worker_killer_initializer.rb
deleted file mode 100644
index 957faf797b5..00000000000
--- a/lib/gitlab/cluster/puma_worker_killer_initializer.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module Cluster
- class PumaWorkerKillerInitializer
- def self.start(
- puma_options,
- puma_per_worker_max_memory_mb: 1200,
- puma_master_max_memory_mb: 950,
- additional_puma_dev_max_memory_mb: 200)
-
- # We are replacing PWK with Watchdog by using backward compatible RssMemoryLimit monitor by default.
- # https://gitlab.com/groups/gitlab-org/-/epics/9119
- return if Gitlab::Utils.to_boolean(ENV.fetch('GITLAB_MEMORY_WATCHDOG_ENABLED', true))
-
- require 'puma_worker_killer'
-
- PumaWorkerKiller.config do |config|
- worker_count = puma_options[:workers] || 1
- # The Puma Worker Killer checks the total memory used by the cluster,
- # i.e. both primary and worker processes.
- # https://github.com/schneems/puma_worker_killer/blob/v0.1.0/lib/puma_worker_killer/puma_memory.rb#L57
- #
- # Additional memory is added when running in `development`
- config.ram = puma_master_max_memory_mb +
- (worker_count * puma_per_worker_max_memory_mb) +
- (Rails.env.development? ? (1 + worker_count) * additional_puma_dev_max_memory_mb : 0)
-
- config.frequency = 20 # seconds
-
- # We just want to limit to a fixed maximum, unrelated to the total amount
- # of available RAM.
- config.percent_usage = 0.98
-
- # Ideally we'll never hit the maximum amount of memory. Restart the workers
- # regularly rather than rely on OOM behavior for periodic restarting.
- config.rolling_restart_frequency = 43200 # 12 hours in seconds.
-
- # Spread the rolling restarts out over 1 hour to avoid too many simultaneous
- # process startups.
- config.rolling_restart_splay_seconds = 0.0..3600.0 # 0 to 1 hour in seconds.
-
- observer = Gitlab::Cluster::PumaWorkerKillerObserver.new
- config.pre_term = observer.callback
- end
-
- PumaWorkerKiller.start
- end
- end
- end
-end
diff --git a/lib/gitlab/cluster/puma_worker_killer_observer.rb b/lib/gitlab/cluster/puma_worker_killer_observer.rb
deleted file mode 100644
index f53051c32ff..00000000000
--- a/lib/gitlab/cluster/puma_worker_killer_observer.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module Cluster
- class PumaWorkerKillerObserver
- def initialize
- @counter = Gitlab::Metrics.counter(:puma_killer_terminations_total, 'Number of workers terminated by PumaWorkerKiller')
- end
-
- # returns the Proc to be used as the observer callback block
- def callback
- method(:log_termination)
- end
-
- private
-
- def log_termination(worker)
- @counter.increment
- end
- end
- end
-end
diff --git a/lib/gitlab/quick_actions/work_item_actions.rb b/lib/gitlab/quick_actions/work_item_actions.rb
index fa43308c9e2..69a49d214ff 100644
--- a/lib/gitlab/quick_actions/work_item_actions.rb
+++ b/lib/gitlab/quick_actions/work_item_actions.rb
@@ -12,9 +12,6 @@ module Gitlab
format(_("Converts work item to %{type}. Widgets not supported in new type are removed."), type: target_type)
end
types WorkItem
- condition do
- quick_action_target&.project&.work_items_mvc_2_feature_flag_enabled?
- end
params 'Task | Objective | Key Result | Issue'
command :type do |type_name|
work_item_type = ::WorkItems::Type.find_by_name(type_name)
diff --git a/lib/gitlab/usage_data_counters/known_events/product_analytics.yml b/lib/gitlab/usage_data_counters/known_events/product_analytics.yml
index 5a791c4b3c2..56a077763c8 100644
--- a/lib/gitlab/usage_data_counters/known_events/product_analytics.yml
+++ b/lib/gitlab/usage_data_counters/known_events/product_analytics.yml
@@ -2,3 +2,5 @@
aggregation: weekly
- name: project_initialized_product_analytics
aggregation: weekly
+- name: user_created_analytics_dashboard
+ aggregation: weekly