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
341f9735
Commit
341f9735
authored
Oct 06, 2021
by
Hordur Freyr Yngvason
Committed by
Aleksei Lipniagov
Oct 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove cluster applications usage data
parent
bea71761
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
187 additions
and
92 deletions
+187
-92
app/models/clusters/integrations/elastic_stack.rb
app/models/clusters/integrations/elastic_stack.rb
+2
-0
app/models/clusters/integrations/prometheus.rb
app/models/clusters/integrations/prometheus.rb
+2
-0
config/metrics/counts_28d/20210216175405_clusters_applications_cert_managers.yml
...8d/20210216175405_clusters_applications_cert_managers.yml
+2
-1
config/metrics/counts_28d/20210216175407_clusters_applications_helm.yml
.../counts_28d/20210216175407_clusters_applications_helm.yml
+2
-1
config/metrics/counts_28d/20210216175409_clusters_applications_ingress.yml
...unts_28d/20210216175409_clusters_applications_ingress.yml
+2
-1
config/metrics/counts_28d/20210216175411_clusters_applications_knative.yml
...unts_28d/20210216175411_clusters_applications_knative.yml
+2
-1
config/metrics/counts_28d/20210216180958_clusters_applications_prometheus.yml
...s_28d/20210216180958_clusters_applications_prometheus.yml
+2
-1
config/metrics/counts_28d/20210216181951_clusters_applications_runner.yml
...ounts_28d/20210216181951_clusters_applications_runner.yml
+2
-1
config/metrics/counts_28d/20210916201533_clusters_integrations_prometheus.yml
...s_28d/20210916201533_clusters_integrations_prometheus.yml
+21
-0
config/metrics/counts_all/20210216175255_clusters_applications_helm.yml
.../counts_all/20210216175255_clusters_applications_helm.yml
+2
-1
config/metrics/counts_all/20210216175257_clusters_applications_ingress.yml
...unts_all/20210216175257_clusters_applications_ingress.yml
+2
-1
config/metrics/counts_all/20210216175259_clusters_applications_cert_managers.yml
...ll/20210216175259_clusters_applications_cert_managers.yml
+2
-1
config/metrics/counts_all/20210216175301_clusters_applications_crossplane.yml
...s_all/20210216175301_clusters_applications_crossplane.yml
+2
-1
config/metrics/counts_all/20210216175303_clusters_applications_prometheus.yml
...s_all/20210216175303_clusters_applications_prometheus.yml
+2
-1
config/metrics/counts_all/20210216175305_clusters_applications_runner.yml
...ounts_all/20210216175305_clusters_applications_runner.yml
+2
-1
config/metrics/counts_all/20210216175307_clusters_applications_knative.yml
...unts_all/20210216175307_clusters_applications_knative.yml
+2
-1
config/metrics/counts_all/20210216175309_clusters_applications_elastic_stack.yml
...ll/20210216175309_clusters_applications_elastic_stack.yml
+2
-1
config/metrics/counts_all/20210216175310_clusters_applications_jupyter.yml
...unts_all/20210216175310_clusters_applications_jupyter.yml
+2
-1
config/metrics/counts_all/20210216175312_clusters_applications_cilium.yml
...ounts_all/20210216175312_clusters_applications_cilium.yml
+2
-1
config/metrics/counts_all/20210216175329_clusters_applications_cert_managers.yml
...ll/20210216175329_clusters_applications_cert_managers.yml
+2
-1
config/metrics/counts_all/20210216175331_clusters_applications_helm.yml
.../counts_all/20210216175331_clusters_applications_helm.yml
+2
-1
config/metrics/counts_all/20210216175333_clusters_applications_ingress.yml
...unts_all/20210216175333_clusters_applications_ingress.yml
+2
-1
config/metrics/counts_all/20210216175335_clusters_applications_knative.yml
...unts_all/20210216175335_clusters_applications_knative.yml
+2
-1
config/metrics/counts_all/20210216180947_clusters_applications_prometheus.yml
...s_all/20210216180947_clusters_applications_prometheus.yml
+2
-1
config/metrics/counts_all/20210216181949_clusters_applications_runner.yml
...ounts_all/20210216181949_clusters_applications_runner.yml
+2
-1
config/metrics/counts_all/20210916200930_clusters_integrations_prometheus.yml
...s_all/20210916200930_clusters_integrations_prometheus.yml
+21
-0
config/metrics/counts_all/20210916200931_clusters_integrations_elastic_stack.yml
...ll/20210916200931_clusters_integrations_elastic_stack.yml
+21
-0
config/metrics/counts_all/20210916202342_clusters_integrations_prometheus.yml
...s_all/20210916202342_clusters_integrations_prometheus.yml
+21
-0
db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb
...3_add_index_on_clusters_integration_prometheus_enabled.rb
+15
-0
db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb
...dd_index_on_clusters_integration_elastic_stack_enabled.rb
+15
-0
db/schema_migrations/20210915000453
db/schema_migrations/20210915000453
+1
-0
db/schema_migrations/20210915001242
db/schema_migrations/20210915001242
+1
-0
db/structure.sql
db/structure.sql
+4
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+6
-19
spec/factories/usage_data.rb
spec/factories/usage_data.rb
+3
-11
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+8
-31
spec/support/helpers/usage_data_helpers.rb
spec/support/helpers/usage_data_helpers.rb
+2
-9
No files found.
app/models/clusters/integrations/elastic_stack.rb
View file @
341f9735
...
...
@@ -14,6 +14,8 @@ module Clusters
validates
:cluster
,
presence:
true
validates
:enabled
,
inclusion:
{
in:
[
true
,
false
]
}
scope
:enabled
,
->
{
where
(
enabled:
true
)
}
def
available?
enabled
end
...
...
app/models/clusters/integrations/prometheus.rb
View file @
341f9735
...
...
@@ -21,6 +21,8 @@ module Clusters
default_value_for
(
:alert_manager_token
)
{
SecureRandom
.
hex
}
scope
:enabled
,
->
{
where
(
enabled:
true
)
}
after_destroy
do
run_after_commit
do
deactivate_project_integrations
...
...
config/metrics/counts_28d/20210216175405_clusters_applications_cert_managers.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
28d
data_source
:
database
distribution
:
...
...
@@ -20,3 +20,4 @@ tier:
name
:
'
count_distinct_user_id_from_clusters_applications_cert_managers'
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_28d/20210216175407_clusters_applications_helm.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
28d
data_source
:
database
distribution
:
...
...
@@ -20,3 +20,4 @@ tier:
name
:
'
count_distinct_user_id_from_clusters_applications_helm'
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_28d/20210216175409_clusters_applications_ingress.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
28d
data_source
:
database
distribution
:
...
...
@@ -20,3 +20,4 @@ tier:
name
:
'
count_distinct_user_id_from_clusters_applications_ingress'
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_28d/20210216175411_clusters_applications_knative.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
28d
data_source
:
database
distribution
:
...
...
@@ -20,3 +20,4 @@ tier:
name
:
'
count_distinct_user_id_from_clusters_applications_knative'
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_28d/20210216180958_clusters_applications_prometheus.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: monitor
product_group
:
group::monitor
product_category
:
metrics
value_type
:
number
status
:
active
status
:
removed
time_frame
:
28d
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_28d/20210216181951_clusters_applications_runner.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: verify
product_group
:
group::runner
product_category
:
runner
value_type
:
number
status
:
active
status
:
removed
time_frame
:
28d
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_28d/20210916201533_clusters_integrations_prometheus.yml
0 → 100644
View file @
341f9735
---
data_category
:
optional
key_path
:
usage_activity_by_stage_monthly.monitor.clusters_integrations_prometheus
description
:
Users creating clusters with Prometheus integration enabled in last 28 days.
product_section
:
ops
product_stage
:
monitor
product_group
:
group::monitor
product_category
:
metrics
value_type
:
number
status
:
active
time_frame
:
28d
data_source
:
database
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
14.4"
config/metrics/counts_all/20210216175255_clusters_applications_helm.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175257_clusters_applications_ingress.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175259_clusters_applications_cert_managers.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175301_clusters_applications_crossplane.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175303_clusters_applications_prometheus.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175305_clusters_applications_runner.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175307_clusters_applications_knative.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175309_clusters_applications_elastic_stack.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175310_clusters_applications_jupyter.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175312_clusters_applications_cilium.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -19,3 +19,4 @@ tier:
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175329_clusters_applications_cert_managers.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -18,3 +18,4 @@ tier:
-
premium
-
ultimate
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175331_clusters_applications_helm.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -18,3 +18,4 @@ tier:
-
premium
-
ultimate
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175333_clusters_applications_ingress.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -18,3 +18,4 @@ tier:
-
premium
-
ultimate
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216175335_clusters_applications_knative.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -18,3 +18,4 @@ tier:
-
premium
-
ultimate
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216180947_clusters_applications_prometheus.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: monitor
product_group
:
group::monitor
product_category
:
metrics
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -18,3 +18,4 @@ tier:
-
premium
-
ultimate
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210216181949_clusters_applications_runner.yml
View file @
341f9735
...
...
@@ -7,7 +7,7 @@ product_stage: configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
status
:
removed
time_frame
:
all
data_source
:
database
distribution
:
...
...
@@ -18,3 +18,4 @@ tier:
-
premium
-
ultimate
milestone
:
"
<13.9"
milestone_removed
:
"
14.4"
config/metrics/counts_all/20210916200930_clusters_integrations_prometheus.yml
0 → 100644
View file @
341f9735
---
data_category
:
optional
key_path
:
counts.clusters_integrations_prometheus
description
:
Total clusters with Clusters::Integrations::Prometheus enabled
product_section
:
ops
product_stage
:
configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
time_frame
:
all
data_source
:
database
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
14.4"
config/metrics/counts_all/20210916200931_clusters_integrations_elastic_stack.yml
0 → 100644
View file @
341f9735
---
data_category
:
optional
key_path
:
counts.clusters_integrations_elastic_stack
description
:
Total clusters with Clusters::Integrations::ElasticStack enabled
product_section
:
ops
product_stage
:
configure
product_group
:
group::configure
product_category
:
kubernetes_management
value_type
:
number
status
:
active
time_frame
:
all
data_source
:
database
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
14.4"
config/metrics/counts_all/20210916202342_clusters_integrations_prometheus.yml
0 → 100644
View file @
341f9735
---
data_category
:
optional
key_path
:
usage_activity_by_stage.monitor.clusters_integrations_prometheus
description
:
Users creating clusters with Prometheus integration enabled in last 28 days.
product_section
:
ops
product_stage
:
monitor
product_group
:
group::monitor
product_category
:
metrics
value_type
:
number
status
:
active
time_frame
:
all
data_source
:
database
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
performance_indicator_type
:
[]
milestone
:
"
14.4"
db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb
0 → 100644
View file @
341f9735
# frozen_string_literal: true
class
AddIndexOnClustersIntegrationPrometheusEnabled
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
INDEX_NAME
=
'index_clusters_integration_prometheus_enabled'
def
up
add_concurrent_index
(
:clusters_integration_prometheus
,
[
:enabled
,
:created_at
,
:cluster_id
],
name:
INDEX_NAME
)
end
def
down
remove_concurrent_index_by_name
(
:clusters_integration_prometheus
,
INDEX_NAME
)
end
end
db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb
0 → 100644
View file @
341f9735
# frozen_string_literal: true
class
AddIndexOnClustersIntegrationElasticStackEnabled
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
INDEX_NAME
=
'index_clusters_integration_elasticstack_enabled'
def
up
add_concurrent_index
(
:clusters_integration_elasticstack
,
[
:enabled
,
:created_at
,
:cluster_id
],
name:
INDEX_NAME
)
end
def
down
remove_concurrent_index_by_name
(
:clusters_integration_elasticstack
,
INDEX_NAME
)
end
end
db/schema_migrations/20210915000453
0 → 100644
View file @
341f9735
ffb4e066420e1492550255e5866df6dc9f83d3d6cec9033284c4c3194d53b827
\ No newline at end of file
db/schema_migrations/20210915001242
0 → 100644
View file @
341f9735
fc8f86f794d77902fd86acaec6046b65821ff685f841d28158dc05fb55773c16
\ No newline at end of file
db/structure.sql
View file @
341f9735
...
...
@@ -24745,6 +24745,10 @@ CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON cluster
CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id);
CREATE INDEX index_clusters_integration_elasticstack_enabled ON clusters_integration_elasticstack USING btree (enabled, created_at, cluster_id);
CREATE INDEX index_clusters_integration_prometheus_enabled ON clusters_integration_prometheus USING btree (enabled, created_at, cluster_id);
CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_id ON clusters_kubernetes_namespaces USING btree (cluster_id);
CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_project_id ON clusters_kubernetes_namespaces USING btree (cluster_project_id);
lib/gitlab/usage_data.rb
View file @
341f9735
...
...
@@ -123,17 +123,9 @@ module Gitlab
clusters_platforms_eks:
count
(
::
Clusters
::
Cluster
.
aws_installed
.
enabled
),
clusters_platforms_gke:
count
(
::
Clusters
::
Cluster
.
gcp_installed
.
enabled
),
clusters_platforms_user:
count
(
::
Clusters
::
Cluster
.
user_provided
.
enabled
),
clusters_applications_helm:
count
(
::
Clusters
::
Applications
::
Helm
.
available
),
clusters_applications_ingress:
count
(
::
Clusters
::
Applications
::
Ingress
.
available
),
clusters_applications_cert_managers:
count
(
::
Clusters
::
Applications
::
CertManager
.
available
),
clusters_applications_crossplane:
count
(
::
Clusters
::
Applications
::
Crossplane
.
available
),
clusters_applications_prometheus:
count
(
::
Clusters
::
Applications
::
Prometheus
.
available
),
clusters_applications_runner:
count
(
::
Clusters
::
Applications
::
Runner
.
available
),
clusters_applications_knative:
count
(
::
Clusters
::
Applications
::
Knative
.
available
),
clusters_applications_elastic_stack:
count
(
::
Clusters
::
Applications
::
ElasticStack
.
available
),
clusters_applications_jupyter:
count
(
::
Clusters
::
Applications
::
Jupyter
.
available
),
clusters_applications_cilium:
count
(
::
Clusters
::
Applications
::
Cilium
.
available
),
clusters_management_project:
count
(
::
Clusters
::
Cluster
.
with_management_project
),
clusters_integrations_elastic_stack:
count
(
::
Clusters
::
Integrations
::
ElasticStack
.
enabled
),
clusters_integrations_prometheus:
count
(
::
Clusters
::
Integrations
::
Prometheus
.
enabled
),
kubernetes_agents:
count
(
::
Clusters
::
Agent
),
kubernetes_agents_with_token:
distinct_count
(
::
Clusters
::
AgentToken
,
:agent_id
),
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
...
...
@@ -523,10 +515,6 @@ module Gitlab
# rubocop: disable UsageData/LargeTable
def
usage_activity_by_stage_configure
(
time_period
)
{
clusters_applications_cert_managers:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applications
::
CertManager
,
time_period
),
clusters_applications_helm:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applications
::
Helm
,
time_period
),
clusters_applications_ingress:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applications
::
Ingress
,
time_period
),
clusters_applications_knative:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applications
::
Knative
,
time_period
),
clusters_management_project:
clusters_user_distinct_count
(
::
Clusters
::
Cluster
.
with_management_project
,
time_period
),
clusters_disabled:
clusters_user_distinct_count
(
::
Clusters
::
Cluster
.
disabled
,
time_period
),
clusters_enabled:
clusters_user_distinct_count
(
::
Clusters
::
Cluster
.
enabled
,
time_period
),
...
...
@@ -621,7 +609,7 @@ module Gitlab
{
clusters:
distinct_count
(
::
Clusters
::
Cluster
.
where
(
time_period
),
:user_id
),
clusters_
applications_prometheus:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applic
ations
::
Prometheus
,
time_period
),
clusters_
integrations_prometheus:
cluster_integrations_user_distinct_count
(
::
Clusters
::
Integr
ations
::
Prometheus
,
time_period
),
operations_dashboard_default_dashboard:
count
(
::
User
.
active
.
with_dashboard
(
'operations'
).
where
(
time_period
),
start:
minimum_id
(
User
),
finish:
maximum_id
(
User
)),
...
...
@@ -685,8 +673,7 @@ module Gitlab
ci_pipeline_config_repository:
distinct_count
(
::
Ci
::
Pipeline
.
repository_source
.
where
(
time_period
),
:user_id
,
start:
minimum_id
(
User
),
finish:
maximum_id
(
User
)),
ci_pipeline_schedules:
distinct_count
(
::
Ci
::
PipelineSchedule
.
where
(
time_period
),
:owner_id
),
ci_pipelines:
distinct_count
(
::
Ci
::
Pipeline
.
where
(
time_period
),
:user_id
,
start:
minimum_id
(
User
),
finish:
maximum_id
(
User
)),
ci_triggers:
distinct_count
(
::
Ci
::
Trigger
.
where
(
time_period
),
:owner_id
),
clusters_applications_runner:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applications
::
Runner
,
time_period
)
ci_triggers:
distinct_count
(
::
Ci
::
Trigger
.
where
(
time_period
),
:owner_id
)
}
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
@@ -867,8 +854,8 @@ module Gitlab
end
# rubocop: disable CodeReuse/ActiveRecord
def
cluster_
applications_user_distinct_count
(
applic
ations
,
time_period
)
distinct_count
(
applications
.
where
(
time_period
).
available
.
joins
(
:cluster
),
'clusters.user_id'
)
def
cluster_
integrations_user_distinct_count
(
integr
ations
,
time_period
)
distinct_count
(
integrations
.
where
(
time_period
).
enabled
.
joins
(
:cluster
),
'clusters.user_id'
)
end
def
clusters_user_distinct_count
(
clusters
,
time_period
)
...
...
spec/factories/usage_data.rb
View file @
341f9735
...
...
@@ -88,17 +88,9 @@ FactoryBot.define do
create
(
:cluster
,
:group
,
:disabled
)
create
(
:cluster
,
:instance
,
:disabled
)
# Applications
create
(
:clusters_applications_helm
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_ingress
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_cert_manager
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_prometheus
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_crossplane
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_runner
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_knative
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_elastic_stack
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_jupyter
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_cilium
,
:installed
,
cluster:
gcp_cluster
)
# Cluster Integrations
create
(
:clusters_integrations_prometheus
,
cluster:
gcp_cluster
)
create
(
:clusters_integrations_elastic_stack
,
cluster:
gcp_cluster
)
create
(
:grafana_integration
,
project:
projects
[
0
],
enabled:
true
)
create
(
:grafana_integration
,
project:
projects
[
1
],
enabled:
true
)
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
341f9735
...
...
@@ -101,11 +101,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
it
'includes accurate usage_activity_by_stage data'
do
for_defined_days_back
do
user
=
create
(
:user
)
cluster
=
create
(
:cluster
,
user:
user
)
create
(
:clusters_applications_cert_manager
,
:installed
,
cluster:
cluster
)
create
(
:clusters_applications_helm
,
:installed
,
cluster:
cluster
)
create
(
:clusters_applications_ingress
,
:installed
,
cluster:
cluster
)
create
(
:clusters_applications_knative
,
:installed
,
cluster:
cluster
)
create
(
:cluster
,
user:
user
)
create
(
:cluster
,
:disabled
,
user:
user
)
create
(
:cluster_provider_gcp
,
:created
)
create
(
:cluster_provider_aws
,
:created
)
...
...
@@ -118,10 +114,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
expect
(
described_class
.
usage_activity_by_stage_configure
({})).
to
include
(
clusters_applications_cert_managers:
2
,
clusters_applications_helm:
2
,
clusters_applications_ingress:
2
,
clusters_applications_knative:
2
,
clusters_management_project:
2
,
clusters_disabled:
4
,
clusters_enabled:
12
,
...
...
@@ -136,10 +128,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
project_clusters_enabled:
10
)
expect
(
described_class
.
usage_activity_by_stage_configure
(
described_class
.
monthly_time_range_db_params
)).
to
include
(
clusters_applications_cert_managers:
1
,
clusters_applications_helm:
1
,
clusters_applications_ingress:
1
,
clusters_applications_knative:
1
,
clusters_management_project:
1
,
clusters_disabled:
2
,
clusters_enabled:
6
,
...
...
@@ -392,7 +380,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
user
=
create
(
:user
,
dashboard:
'operations'
)
cluster
=
create
(
:cluster
,
user:
user
)
project
=
create
(
:project
,
creator:
user
)
create
(
:clusters_
applications_prometheus
,
:installed
,
cluster:
cluster
)
create
(
:clusters_
integrations_prometheus
,
cluster:
cluster
)
create
(
:project_tracing_setting
)
create
(
:project_error_tracking_setting
)
create
(
:incident
)
...
...
@@ -402,7 +390,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
described_class
.
usage_activity_by_stage_monitor
({})).
to
include
(
clusters:
2
,
clusters_
applic
ations_prometheus:
2
,
clusters_
integr
ations_prometheus:
2
,
operations_dashboard_default_dashboard:
2
,
projects_with_tracing_enabled:
2
,
projects_with_error_tracking_enabled:
2
,
...
...
@@ -414,7 +402,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
data_28_days
=
described_class
.
usage_activity_by_stage_monitor
(
described_class
.
monthly_time_range_db_params
)
expect
(
data_28_days
).
to
include
(
clusters:
1
,
clusters_
applic
ations_prometheus:
1
,
clusters_
integr
ations_prometheus:
1
,
operations_dashboard_default_dashboard:
1
,
projects_with_tracing_enabled:
1
,
projects_with_error_tracking_enabled:
1
,
...
...
@@ -499,7 +487,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
create
(
:ci_pipeline
,
:repository_source
,
user:
user
)
create
(
:ci_pipeline_schedule
,
owner:
user
)
create
(
:ci_trigger
,
owner:
user
)
create
(
:clusters_applications_runner
,
:installed
)
end
expect
(
described_class
.
usage_activity_by_stage_verify
({})).
to
include
(
...
...
@@ -510,8 +497,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
ci_pipeline_config_repository:
2
,
ci_pipeline_schedules:
2
,
ci_pipelines:
2
,
ci_triggers:
2
,
clusters_applications_runner:
2
ci_triggers:
2
)
expect
(
described_class
.
usage_activity_by_stage_verify
(
described_class
.
monthly_time_range_db_params
)).
to
include
(
ci_builds:
1
,
...
...
@@ -521,8 +507,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
ci_pipeline_config_repository:
1
,
ci_pipeline_schedules:
1
,
ci_pipelines:
1
,
ci_triggers:
1
,
clusters_applications_runner:
1
ci_triggers:
1
)
end
end
...
...
@@ -604,17 +589,9 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
count_data
[
:clusters_platforms_eks
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_platforms_gke
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_platforms_user
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_helm
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_ingress
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_cert_managers
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_crossplane
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_prometheus
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_runner
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_knative
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_elastic_stack
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_integrations_elastic_stack
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_integrations_prometheus
]).
to
eq
(
1
)
expect
(
count_data
[
:grafana_integrated_projects
]).
to
eq
(
2
)
expect
(
count_data
[
:clusters_applications_jupyter
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_cilium
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_management_project
]).
to
eq
(
1
)
expect
(
count_data
[
:kubernetes_agents
]).
to
eq
(
2
)
expect
(
count_data
[
:kubernetes_agents_with_token
]).
to
eq
(
1
)
...
...
spec/support/helpers/usage_data_helpers.rb
View file @
341f9735
...
...
@@ -54,15 +54,8 @@ module UsageDataHelpers
clusters_platforms_eks
clusters_platforms_gke
clusters_platforms_user
clusters_applications_helm
clusters_applications_ingress
clusters_applications_cert_managers
clusters_applications_prometheus
clusters_applications_crossplane
clusters_applications_runner
clusters_applications_knative
clusters_applications_elastic_stack
clusters_applications_jupyter
clusters_integrations_elastic_stack
clusters_integrations_prometheus
clusters_management_project
in_review_folder
grafana_integrated_projects
...
...
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