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
4dbd1e2c
Commit
4dbd1e2c
authored
Sep 01, 2020
by
James Fargher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'usage_ping_agent_token' into 'master'
Usage ping agent token See merge request gitlab-org/gitlab!40563
parents
88a3cf8b
a8cbb3cd
Changes
5
Hide 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 @
4dbd1e2c
---
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 @
4dbd1e2c
...
...
@@ -112,6 +112,7 @@ module Gitlab
clusters_applications_cilium:
count
(
::
Clusters
::
Applications
::
Cilium
.
available
),
clusters_management_project:
count
(
::
Clusters
::
Cluster
.
with_management_project
),
kubernetes_agents:
count
(
::
Clusters
::
Agent
),
kubernetes_agents_with_token:
distinct_count
(
::
Clusters
::
AgentToken
,
:agent_id
),
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
grafana_integrated_projects:
count
(
GrafanaIntegration
.
enabled
),
groups:
count
(
Group
),
...
...
rubocop/rubocop-usage-data.yml
View file @
4dbd1e2c
...
...
@@ -45,3 +45,4 @@ UsageData/DistinctCountByLargeForeignKey:
-
:issue_id
-
:merge_request_id
-
:merge_requests.target_project_id
-
:agent_id
spec/factories/usage_data.rb
View file @
4dbd1e2c
...
...
@@ -67,6 +67,7 @@ FactoryBot.define do
# Kubernetes agents
create
(
:cluster_agent
,
project:
projects
[
0
])
create
(
:cluster_agent_token
,
agent:
create
(
:cluster_agent
,
project:
projects
[
1
])
)
# Enabled clusters
gcp_cluster
=
create
(
:cluster_provider_gcp
,
:created
).
cluster
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
4dbd1e2c
...
...
@@ -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_cilium
]).
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
[
: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