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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-03 06:07:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-03 06:07:34 +0300
commitc1efda3e21330804ea49a7ff4c87a7d35131ee7b (patch)
tree55f60fef44517a80d73afd8fc9fa6e12a7f6d8d4 /lib/gitlab/usage
parent198460d5879a516844f81f667c6bc4fe84ed1719 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/usage')
-rw-r--r--lib/gitlab/usage/metrics/instrumentations/count_projects_with_monitor_enabled_metric.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gitlab/usage/metrics/instrumentations/count_projects_with_monitor_enabled_metric.rb b/lib/gitlab/usage/metrics/instrumentations/count_projects_with_monitor_enabled_metric.rb
new file mode 100644
index 00000000000..2a560233390
--- /dev/null
+++ b/lib/gitlab/usage/metrics/instrumentations/count_projects_with_monitor_enabled_metric.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Usage
+ module Metrics
+ module Instrumentations
+ class CountProjectsWithMonitorEnabledMetric < DatabaseMetric
+ operation :count
+
+ metric_options do
+ {
+ batch_size: 10_000
+ }
+ end
+
+ relation { ProjectFeature.where.not(monitor_access_level: ProjectFeature::DISABLED) }
+ end
+ end
+ end
+ end
+end