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
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/usage_data_counters.rb')
-rw-r--r--lib/gitlab/usage_data_counters.rb35
1 files changed, 19 insertions, 16 deletions
diff --git a/lib/gitlab/usage_data_counters.rb b/lib/gitlab/usage_data_counters.rb
index eae1c593a8f..37c6e1af7c0 100644
--- a/lib/gitlab/usage_data_counters.rb
+++ b/lib/gitlab/usage_data_counters.rb
@@ -2,25 +2,24 @@
module Gitlab
module UsageDataCounters
- COUNTERS = [
- WikiPageCounter,
- NoteCounter,
- SnippetCounter,
- SearchCounter,
- CycleAnalyticsCounter,
- ProductivityAnalyticsCounter,
- SourceCodeCounter,
- KubernetesAgentCounter,
- MergeRequestWidgetExtensionCounter
- ].freeze
+ COUNTERS = [].freeze
COUNTERS_MIGRATED_TO_INSTRUMENTATION_CLASSES = [
PackageEventCounter,
MergeRequestCounter,
DesignsCounter,
DiffsCounter,
+ KubernetesAgentCounter,
+ NoteCounter,
+ SearchCounter,
ServiceUsageDataCounter,
- WebIdeCounter
+ WebIdeCounter,
+ WikiPageCounter,
+ SnippetCounter,
+ CycleAnalyticsCounter,
+ ProductivityAnalyticsCounter,
+ SourceCodeCounter,
+ MergeRequestWidgetExtensionCounter
].freeze
UsageDataCounterError = Class.new(StandardError)
@@ -28,13 +27,11 @@ module Gitlab
class << self
def unmigrated_counters
- # we are using the #counters method instead of the COUNTERS const
- # to make sure it's working correctly for `ee` version of UsageDataCounters
- counters - self::COUNTERS_MIGRATED_TO_INSTRUMENTATION_CLASSES
+ self::COUNTERS
end
def counters
- self::COUNTERS + self::COUNTERS_MIGRATED_TO_INSTRUMENTATION_CLASSES
+ unmigrated_counters + migrated_counters
end
def count(event_name)
@@ -46,6 +43,12 @@ module Gitlab
raise UnknownEvent, "Cannot find counter for event #{event_name}"
end
+
+ private
+
+ def migrated_counters
+ COUNTERS_MIGRATED_TO_INSTRUMENTATION_CLASSES
+ end
end
end
end