Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-16 06:16:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-16 06:16:18 +0300
commit555976016b899c8507cd58196e6c9f647fa6b19e (patch)
tree625368df60c700c5bc8bec2520b3524cfe42da00 /lib
parent84025108bca604c1428d2cf6a6b69616ee90956c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/redis/buffered_counter.rb6
-rw-r--r--lib/gitlab/tracking/event_definition.rb11
2 files changed, 3 insertions, 14 deletions
diff --git a/lib/gitlab/redis/buffered_counter.rb b/lib/gitlab/redis/buffered_counter.rb
index ea619d60eee..21fc4ba8034 100644
--- a/lib/gitlab/redis/buffered_counter.rb
+++ b/lib/gitlab/redis/buffered_counter.rb
@@ -7,12 +7,6 @@ module Gitlab
def config_fallback
SharedState
end
-
- def params
- # This avoid using Gitlab::Instrumentation::Redis::BufferedCounter since this class is a temporary
- # helper for migration. The redis commands should be tracked under the label of `storage: shared_state`.
- super.merge({ instrumentation_class: ::Gitlab::Instrumentation::Redis::SharedState })
- end
end
end
end
diff --git a/lib/gitlab/tracking/event_definition.rb b/lib/gitlab/tracking/event_definition.rb
index 928eb6338f6..9d197de454e 100644
--- a/lib/gitlab/tracking/event_definition.rb
+++ b/lib/gitlab/tracking/event_definition.rb
@@ -17,9 +17,7 @@ module Gitlab
end
def definitions
- paths.each_with_object({}) do |glob_path, definitions|
- load_all_from_path!(definitions, glob_path)
- end
+ paths.flat_map { |glob_path| load_all_from_path(glob_path) }
end
private
@@ -34,11 +32,8 @@ module Gitlab
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(Gitlab::Tracking::InvalidEventError.new(e.message))
end
- def load_all_from_path!(definitions, glob_path)
- Dir.glob(glob_path).each do |path|
- definition = load_from_file(path)
- definitions[definition.path] = definition
- end
+ def load_all_from_path(glob_path)
+ Dir.glob(glob_path).map { |path| load_from_file(path) }
end
end