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
a8cbb3cd
Commit
a8cbb3cd
authored
Aug 27, 2020
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage metric around agents which have a token
parent
880d6289
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
1 deletion
+10
-1
changelogs/unreleased/usage_ping_agent_token.yml
changelogs/unreleased/usage_ping_agent_token.yml
+5
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-0
rubocop/rubocop-usage-data.yml
rubocop/rubocop-usage-data.yml
+1
-0
spec/factories/usage_data.rb
spec/factories/usage_data.rb
+1
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+2
-1
No files found.
changelogs/unreleased/usage_ping_agent_token.yml
0 → 100644
View file @
a8cbb3cd
---
title
:
Add usage ping for distinct count for kubernetes agents for at least one token
merge_request
:
40563
author
:
type
:
other
lib/gitlab/usage_data.rb
View file @
a8cbb3cd
...
@@ -112,6 +112,7 @@ module Gitlab
...
@@ -112,6 +112,7 @@ module Gitlab
clusters_applications_cilium:
count
(
::
Clusters
::
Applications
::
Cilium
.
available
),
clusters_applications_cilium:
count
(
::
Clusters
::
Applications
::
Cilium
.
available
),
clusters_management_project:
count
(
::
Clusters
::
Cluster
.
with_management_project
),
clusters_management_project:
count
(
::
Clusters
::
Cluster
.
with_management_project
),
kubernetes_agents:
count
(
::
Clusters
::
Agent
),
kubernetes_agents:
count
(
::
Clusters
::
Agent
),
kubernetes_agents_with_token:
distinct_count
(
::
Clusters
::
AgentToken
,
:agent_id
),
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
grafana_integrated_projects:
count
(
GrafanaIntegration
.
enabled
),
grafana_integrated_projects:
count
(
GrafanaIntegration
.
enabled
),
groups:
count
(
Group
),
groups:
count
(
Group
),
...
...
rubocop/rubocop-usage-data.yml
View file @
a8cbb3cd
...
@@ -45,3 +45,4 @@ UsageData/DistinctCountByLargeForeignKey:
...
@@ -45,3 +45,4 @@ UsageData/DistinctCountByLargeForeignKey:
-
:issue_id
-
:issue_id
-
:merge_request_id
-
:merge_request_id
-
:merge_requests.target_project_id
-
:merge_requests.target_project_id
-
:agent_id
spec/factories/usage_data.rb
View file @
a8cbb3cd
...
@@ -67,6 +67,7 @@ FactoryBot.define do
...
@@ -67,6 +67,7 @@ FactoryBot.define do
# Kubernetes agents
# Kubernetes agents
create
(
:cluster_agent
,
project:
projects
[
0
])
create
(
:cluster_agent
,
project:
projects
[
0
])
create
(
:cluster_agent_token
,
agent:
create
(
:cluster_agent
,
project:
projects
[
1
])
)
# Enabled clusters
# Enabled clusters
gcp_cluster
=
create
(
:cluster_provider_gcp
,
:created
).
cluster
gcp_cluster
=
create
(
:cluster_provider_gcp
,
:created
).
cluster
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
a8cbb3cd
...
@@ -460,7 +460,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -460,7 +460,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
count_data
[
:clusters_applications_jupyter
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_jupyter
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_cilium
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_cilium
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_management_project
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_management_project
]).
to
eq
(
1
)
expect
(
count_data
[
:kubernetes_agents
]).
to
eq
(
1
)
expect
(
count_data
[
:kubernetes_agents
]).
to
eq
(
2
)
expect
(
count_data
[
:kubernetes_agents_with_token
]).
to
eq
(
1
)
expect
(
count_data
[
:deployments
]).
to
eq
(
4
)
expect
(
count_data
[
:deployments
]).
to
eq
(
4
)
expect
(
count_data
[
:successful_deployments
]).
to
eq
(
2
)
expect
(
count_data
[
:successful_deployments
]).
to
eq
(
2
)
...
...
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