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
0d45b816
Commit
0d45b816
authored
Jan 11, 2021
by
Scott Hampton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage ping for repo analytics page
Usage ping for every user that views the repo analytics page.
parent
326cc0ca
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
0 deletions
+33
-0
config/feature_flags/development/usage_data_i_testing_group_code_coverage_visit_total.yml
.../usage_data_i_testing_group_code_coverage_visit_total.yml
+8
-0
ee/app/controllers/groups/analytics/repository_analytics_controller.rb
...llers/groups/analytics/repository_analytics_controller.rb
+2
-0
ee/changelogs/unreleased/224624-usage-ping-code-coverage.yml
ee/changelogs/unreleased/224624-usage-ping-code-coverage.yml
+5
-0
ee/spec/controllers/groups/analytics/repository_analytics_controller_spec.rb
.../groups/analytics/repository_analytics_controller_spec.rb
+13
-0
lib/gitlab/usage_data_counters/known_events/common.yml
lib/gitlab/usage_data_counters/known_events/common.yml
+5
-0
No files found.
config/feature_flags/development/usage_data_i_testing_group_code_coverage_visit_total.yml
0 → 100644
View file @
0d45b816
---
name
:
usage_data_i_testing_group_code_coverage_visit_total
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51382
rollout_issue_url
:
milestone
:
'
13.8'
type
:
development
group
:
group::testing
default_enabled
:
true
ee/app/controllers/groups/analytics/repository_analytics_controller.rb
View file @
0d45b816
# frozen_string_literal: true
class
Groups::Analytics::RepositoryAnalyticsController
<
Groups
::
Analytics
::
ApplicationController
include
RedisTracking
layout
'group'
before_action
:load_group
before_action
->
{
check_feature_availability!
(
:group_repository_analytics
)
}
before_action
->
{
authorize_view_by_action!
(
:read_group_repository_analytics
)
}
track_redis_hll_event
:show
,
name:
'i_testing_group_code_coverage_visit_total'
,
feature: :usage_data_i_testing_group_code_coverage_visit_total
,
feature_default_enabled:
true
def
show
track_event
(
**
pageview_tracker_params
)
...
...
ee/changelogs/unreleased/224624-usage-ping-code-coverage.yml
0 → 100644
View file @
0d45b816
---
title
:
Capture unique user views of group repository analytics page
merge_request
:
51382
author
:
type
:
added
ee/spec/controllers/groups/analytics/repository_analytics_controller_spec.rb
View file @
0d45b816
...
...
@@ -33,6 +33,19 @@ RSpec.describe Groups::Analytics::RepositoryAnalyticsController do
)
end
context
'unique users tracking'
do
before
do
allow
(
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
).
to
receive
(
:track_event
)
end
it_behaves_like
'tracking unique hll events'
,
:usage_data_i_testing_group_code_coverage_visit_total
do
subject
(
:request
)
{
get
:show
,
params:
{
group_id:
group
}
}
let
(
:target_id
)
{
'i_testing_group_code_coverage_visit_total'
}
let
(
:expected_type
)
{
instance_of
(
String
)
}
end
end
context
'when license is missing'
do
before
do
stub_licensed_features
(
feature_name
=>
false
)
...
...
lib/gitlab/usage_data_counters/known_events/common.yml
View file @
0d45b816
...
...
@@ -253,6 +253,11 @@
redis_slot
:
testing
aggregation
:
weekly
feature_flag
:
usage_data_i_testing_metrics_report_widget_total
-
name
:
i_testing_group_code_coverage_visit_total
category
:
testing
redis_slot
:
testing
aggregation
:
weekly
feature_flag
:
usage_data_i_testing_group_code_coverage_visit_total
# Project Management group
-
name
:
g_project_management_issue_title_changed
category
:
issues_edit
...
...
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