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
32843982
Commit
32843982
authored
Nov 13, 2019
by
Allison Browne
Committed by
Andreas Brandl
Nov 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Count grafana integrated projects
Add a count of grafana integrated projects within the usage ping
parent
126a1c0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
app/models/grafana_integration.rb
app/models/grafana_integration.rb
+2
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+6
-0
No files found.
app/models/grafana_integration.rb
View file @
32843982
...
...
@@ -16,6 +16,8 @@ class GrafanaIntegration < ApplicationRecord
validates
:enabled
,
inclusion:
{
in:
[
true
,
false
]
}
scope
:enabled
,
->
{
where
(
enabled:
true
)
}
def
client
return
unless
enabled?
...
...
lib/gitlab/usage_data.rb
View file @
32843982
...
...
@@ -78,6 +78,7 @@ module Gitlab
clusters_applications_knative:
count
(
::
Clusters
::
Applications
::
Knative
.
available
),
clusters_applications_elastic_stack:
count
(
::
Clusters
::
Applications
::
ElasticStack
.
available
),
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
grafana_integrated_projects:
count
(
GrafanaIntegration
.
enabled
),
groups:
count
(
Group
),
issues:
count
(
Issue
),
issues_with_associated_zoom_link:
count
(
ZoomMeeting
.
added_to_issue
),
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
32843982
...
...
@@ -48,6 +48,10 @@ describe Gitlab::UsageData do
create
(
:clusters_applications_knative
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_elastic_stack
,
:installed
,
cluster:
gcp_cluster
)
create
(
:grafana_integration
,
project:
projects
[
0
],
enabled:
true
)
create
(
:grafana_integration
,
project:
projects
[
1
],
enabled:
true
)
create
(
:grafana_integration
,
project:
projects
[
2
],
enabled:
false
)
ProjectFeature
.
first
.
update_attribute
(
'repository_access_level'
,
0
)
end
...
...
@@ -140,6 +144,7 @@ describe Gitlab::UsageData do
clusters_applications_knative
clusters_applications_elastic_stack
in_review_folder
grafana_integrated_projects
groups
issues
issues_with_associated_zoom_link
...
...
@@ -221,6 +226,7 @@ describe Gitlab::UsageData do
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
[
:grafana_integrated_projects
]).
to
eq
(
2
)
end
it
'works when queries time out'
do
...
...
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