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
0269e314
Commit
0269e314
authored
Sep 14, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Instance Statistics to usage ping
parent
1d84b14b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
3 deletions
+33
-3
app/controllers/admin/instance_statistics_controller.rb
app/controllers/admin/instance_statistics_controller.rb
+4
-0
changelogs/unreleased/233919-add-instance-statistics-to-usage-ping.yml
...released/233919-add-instance-statistics-to-usage-ping.yml
+5
-0
ee/spec/controllers/admin/credentials_controller_spec.rb
ee/spec/controllers/admin/credentials_controller_spec.rb
+0
-1
lib/gitlab/usage_data_counters/known_events.yml
lib/gitlab/usage_data_counters/known_events.yml
+4
-0
spec/controllers/admin/cohorts_controller_spec.rb
spec/controllers/admin/cohorts_controller_spec.rb
+0
-1
spec/controllers/admin/dev_ops_report_controller_spec.rb
spec/controllers/admin/dev_ops_report_controller_spec.rb
+0
-1
spec/controllers/admin/instance_statistics_controller_spec.rb
.../controllers/admin/instance_statistics_controller_spec.rb
+17
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+1
-0
spec/support/shared_examples/controllers/unique_visits_shared_examples.rb
...red_examples/controllers/unique_visits_shared_examples.rb
+2
-0
No files found.
app/controllers/admin/instance_statistics_controller.rb
View file @
0269e314
# frozen_string_literal: true
class
Admin::InstanceStatisticsController
<
Admin
::
ApplicationController
include
Analytics
::
UniqueVisitsHelper
before_action
:check_feature_flag
track_unique_visits
:index
,
target_id:
'i_analytics_instance_statistics'
def
index
end
...
...
changelogs/unreleased/233919-add-instance-statistics-to-usage-ping.yml
0 → 100644
View file @
0269e314
---
title
:
Add instance statistics visits to usage data
merge_request
:
42211
author
:
type
:
other
ee/spec/controllers/admin/credentials_controller_spec.rb
View file @
0269e314
...
...
@@ -21,7 +21,6 @@ RSpec.describe Admin::CredentialsController do
end
it_behaves_like
'tracking unique visits'
,
:index
do
let
(
:request_params
)
{
{}
}
let
(
:target_id
)
{
'i_compliance_credential_inventory'
}
end
...
...
lib/gitlab/usage_data_counters/known_events.yml
View file @
0269e314
...
...
@@ -77,6 +77,10 @@
category
:
analytics
redis_slot
:
analytics
aggregation
:
weekly
-
name
:
i_analytics_instance_statistics
category
:
analytics
redis_slot
:
analytics
aggregation
:
weekly
-
name
:
g_edit_by_web_ide
category
:
ide_edit
redis_slot
:
edit
...
...
spec/controllers/admin/cohorts_controller_spec.rb
View file @
0269e314
...
...
@@ -18,7 +18,6 @@ RSpec.describe Admin::CohortsController do
describe
'GET #index'
do
it_behaves_like
'tracking unique visits'
,
:index
do
let
(
:request_params
)
{
{}
}
let
(
:target_id
)
{
'i_analytics_cohorts'
}
end
end
...
...
spec/controllers/admin/dev_ops_report_controller_spec.rb
View file @
0269e314
...
...
@@ -18,7 +18,6 @@ RSpec.describe Admin::DevOpsReportController do
end
it_behaves_like
'tracking unique visits'
,
:show
do
let
(
:request_params
)
{
{}
}
let
(
:target_id
)
{
'i_analytics_dev_ops_score'
}
end
end
...
...
spec/controllers/admin/instance_statistics_controller_spec.rb
0 → 100644
View file @
0269e314
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Admin
::
InstanceStatisticsController
do
let
(
:admin
)
{
create
(
:user
,
:admin
)
}
before
do
sign_in
(
admin
)
end
describe
'GET #show'
do
it_behaves_like
'tracking unique visits'
,
:index
do
let
(
:target_id
)
{
'i_analytics_instance_statistics'
}
end
end
end
spec/lib/gitlab/usage_data_spec.rb
View file @
0269e314
...
...
@@ -1064,6 +1064,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
'p_analytics_repo'
=>
123
,
'i_analytics_cohorts'
=>
123
,
'i_analytics_dev_ops_score'
=>
123
,
'i_analytics_instance_statistics'
=>
123
,
'p_analytics_merge_request'
=>
123
,
'g_analytics_merge_request'
=>
123
,
'analytics_unique_visits_for_any_target'
=>
543
,
...
...
spec/support/shared_examples/controllers/unique_visits_shared_examples.rb
View file @
0269e314
# frozen_string_literal: true
RSpec
.
shared_examples
'tracking unique visits'
do
|
method
|
let
(
:request_params
)
{
{}
}
it
'tracks unique visit if the format is HTML'
do
expect_any_instance_of
(
Gitlab
::
Analytics
::
UniqueVisits
).
to
receive
(
:track_visit
).
with
(
instance_of
(
String
),
target_id
)
...
...
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