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
42de7d2f
Commit
42de7d2f
authored
Apr 27, 2021
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add redis counters for epic board actions
Tracks viewing, creating and title updating of epic boards.
parent
e5e9d5d3
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
302 additions
and
15 deletions
+302
-15
config/feature_flags/development/track_epic_boards_activity.yml
.../feature_flags/development/track_epic_boards_activity.yml
+8
-0
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+72
-0
ee/app/controllers/groups/epic_boards_controller.rb
ee/app/controllers/groups/epic_boards_controller.rb
+3
-0
ee/app/services/boards/epic_boards/create_service.rb
ee/app/services/boards/epic_boards/create_service.rb
+10
-0
ee/app/services/boards/epic_boards/update_service.rb
ee/app/services/boards/epic_boards/update_service.rb
+10
-0
ee/changelogs/unreleased/epics-board-counter.yml
ee/changelogs/unreleased/epics-board-counter.yml
+5
-0
ee/config/metrics/counts_28d/20210428072511_g_project_management_users_creating_epic_boards_monthly.yml
...project_management_users_creating_epic_boards_monthly.yml
+21
-0
ee/config/metrics/counts_28d/20210428073329_g_project_management_users_viewing_epic_boards_monthly.yml
..._project_management_users_viewing_epic_boards_monthly.yml
+21
-0
ee/config/metrics/counts_28d/20210428073607_g_project_management_users_updating_epic_board_names_monthly.yml
...ct_management_users_updating_epic_board_names_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210428072508_g_project_management_users_creating_epic_boards_weekly.yml
..._project_management_users_creating_epic_boards_weekly.yml
+21
-0
ee/config/metrics/counts_7d/20210428073327_g_project_management_users_viewing_epic_boards_weekly.yml
...g_project_management_users_viewing_epic_boards_weekly.yml
+20
-0
ee/config/metrics/counts_7d/20210428073604_g_project_management_users_updating_epic_board_names_weekly.yml
...ect_management_users_updating_epic_board_names_weekly.yml
+20
-0
ee/spec/controllers/groups/epic_boards_controller_spec.rb
ee/spec/controllers/groups/epic_boards_controller_spec.rb
+25
-11
ee/spec/services/boards/epic_boards/create_service_spec.rb
ee/spec/services/boards/epic_boards/create_service_spec.rb
+10
-1
ee/spec/services/boards/epic_boards/update_service_spec.rb
ee/spec/services/boards/epic_boards/update_service_spec.rb
+7
-0
ee/spec/support/shared_examples/services/boards/create_boards_shared_examples.rb
...examples/services/boards/create_boards_shared_examples.rb
+5
-3
lib/gitlab/usage_data_counters/known_events/epic_board_events.yml
...ab/usage_data_counters/known_events/epic_board_events.yml
+22
-0
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
.../lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
+1
-0
No files found.
config/feature_flags/development/track_epic_boards_activity.yml
0 → 100644
View file @
42de7d2f
---
name
:
track_epic_boards_activity
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60357
rollout_issue_url
:
milestone
:
'
13.12'
type
:
development
group
:
group::product planning
default_enabled
:
true
doc/development/usage_ping/dictionary.md
View file @
42de7d2f
...
...
@@ -10220,6 +10220,78 @@ Status: `data_available`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.epic_boards_usage.g_project_management_users_creating_epic_boards_monthly`
Count of MAU creating epic boards
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210428072511_g_project_management_users_creating_epic_boards_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epic_boards_usage.g_project_management_users_creating_epic_boards_weekly`
Count of WAU creating epic boards
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210428072508_g_project_management_users_creating_epic_boards_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epic_boards_usage.g_project_management_users_updating_epic_board_names_monthly`
Count of MAU updating epic board names
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210428073607_g_project_management_users_updating_epic_board_names_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epic_boards_usage.g_project_management_users_updating_epic_board_names_weekly`
Count of WAU updating epic board names
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210428073604_g_project_management_users_updating_epic_board_names_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epic_boards_usage.g_project_management_users_viewing_epic_boards_monthly`
Count of MAU viewing epic boards
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210428073329_g_project_management_users_viewing_epic_boards_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epic_boards_usage.g_project_management_users_viewing_epic_boards_weekly`
Count of WAU viewing epic boards
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210428073327_g_project_management_users_viewing_epic_boards_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.epics_usage_total_unique_counts_monthly`
Total monthly users count for epics_usage
...
...
ee/app/controllers/groups/epic_boards_controller.rb
View file @
42de7d2f
...
...
@@ -2,6 +2,7 @@
class
Groups::EpicBoardsController
<
Groups
::
ApplicationController
include
BoardsActions
include
RecordUserLastActivity
include
RedisTracking
include
Gitlab
::
Utils
::
StrongMemoize
extend
::
Gitlab
::
Utils
::
Override
...
...
@@ -11,6 +12,8 @@ class Groups::EpicBoardsController < Groups::ApplicationController
push_frontend_feature_flag
(
:boards_filtered_search
,
group
)
end
track_redis_hll_event
:index
,
:show
,
name:
'g_project_management_users_viewing_epic_boards'
feature_category
:boards
private
...
...
ee/app/services/boards/epic_boards/create_service.rb
View file @
42de7d2f
...
...
@@ -3,6 +3,7 @@
module
Boards
module
EpicBoards
class
CreateService
<
Boards
::
CreateService
include
Gitlab
::
Utils
::
UsageData
extend
::
Gitlab
::
Utils
::
Override
override
:can_create_board?
...
...
@@ -14,6 +15,15 @@ module Boards
def
parent_board_collection
parent
.
epic_boards
end
override
:execute
def
execute
super
.
tap
do
|
response
|
if
response
.
success?
track_usage_event
(
:g_project_management_users_creating_epic_boards
,
current_user
.
id
)
end
end
end
end
end
end
ee/app/services/boards/epic_boards/update_service.rb
View file @
42de7d2f
...
...
@@ -3,8 +3,18 @@
module
Boards
module
EpicBoards
class
UpdateService
<
Boards
::
UpdateService
include
Gitlab
::
Utils
::
UsageData
extend
::
Gitlab
::
Utils
::
Override
override
:execute
def
execute
(
board
)
super
.
tap
do
if
board
.
saved_change_to_name?
track_usage_event
(
:g_project_management_users_updating_epic_board_names
,
current_user
.
id
)
end
end
end
override
:permitted_params
def
permitted_params
permitted
=
PERMITTED_PARAMS
...
...
ee/changelogs/unreleased/epics-board-counter.yml
0 → 100644
View file @
42de7d2f
---
title
:
Track epic board user events (viewing, creating and updating titles).
merge_request
:
60357
author
:
type
:
added
ee/config/metrics/counts_28d/20210428072511_g_project_management_users_creating_epic_boards_monthly.yml
0 → 100644
View file @
42de7d2f
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
redis_hll_counters.epic_boards_usage.g_project_management_users_creating_epic_boards_monthly
description
:
Count of MAU creating epic boards
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60357
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_28d/20210428073329_g_project_management_users_viewing_epic_boards_monthly.yml
0 → 100644
View file @
42de7d2f
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
redis_hll_counters.epic_boards_usage.g_project_management_users_viewing_epic_boards_monthly
description
:
Count of MAU viewing epic boards
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60357
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_28d/20210428073607_g_project_management_users_updating_epic_board_names_monthly.yml
0 → 100644
View file @
42de7d2f
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
redis_hll_counters.epic_boards_usage.g_project_management_users_updating_epic_board_names_monthly
description
:
Count of MAU updating epic board names
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60357
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210428072508_g_project_management_users_creating_epic_boards_weekly.yml
0 → 100644
View file @
42de7d2f
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
redis_hll_counters.epic_boards_usage.g_project_management_users_creating_epic_boards_weekly
description
:
Count of WAU creating epic boards
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_boards_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60357
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210428073327_g_project_management_users_viewing_epic_boards_weekly.yml
0 → 100644
View file @
42de7d2f
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
redis_hll_counters.epic_boards_usage.g_project_management_users_viewing_epic_boards_weekly
description
:
Count of WAU viewing epic boards
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_boards_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60357
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210428073604_g_project_management_users_updating_epic_board_names_weekly.yml
0 → 100644
View file @
42de7d2f
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
redis_hll_counters.epic_boards_usage.g_project_management_users_updating_epic_board_names_weekly
description
:
Count of WAU updating epic board names
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_boards_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60357
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/spec/controllers/groups/epic_boards_controller_spec.rb
View file @
42de7d2f
...
...
@@ -3,13 +3,10 @@
require
'spec_helper'
RSpec
.
describe
Groups
::
EpicBoardsController
do
let_it_be
(
:public_group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:private_group
)
{
create
(
:group
,
:private
)
}
let_it_be_with_reload
(
:group
)
{
create
(
:group
,
:private
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:other_user
)
{
create
(
:user
)
}
let
(
:group
)
{
public_group
}
before
do
stub_licensed_features
(
epics:
true
)
...
...
@@ -47,8 +44,6 @@ RSpec.describe Groups::EpicBoardsController do
end
context
'with unauthorized user'
do
let_it_be
(
:group
)
{
private_group
}
before
do
sign_in
(
other_user
)
end
...
...
@@ -77,6 +72,18 @@ RSpec.describe Groups::EpicBoardsController do
let
(
:parent
)
{
group
}
end
it_behaves_like
'tracking unique hll events'
do
# make sure there is at least one board to list
# otherwise a new board would be created as part of
# index action and a different redis counter would be
# triggered first
let_it_be
(
:board
)
{
create
(
:epic_board
,
group:
group
)
}
subject
(
:request
)
{
list_boards
}
let
(
:target_id
)
{
'g_project_management_users_viewing_epic_boards'
}
let
(
:expected_type
)
{
instance_of
(
String
)
}
end
def
list_boards
(
format: :html
)
get
:index
,
params:
{
group_id:
group
},
format:
format
end
...
...
@@ -116,8 +123,6 @@ RSpec.describe Groups::EpicBoardsController do
end
context
'with unauthorized user'
do
let
(
:group
)
{
private_group
}
before
do
# sign in some other user not in the private group
sign_in
(
other_user
)
...
...
@@ -131,10 +136,12 @@ RSpec.describe Groups::EpicBoardsController do
end
end
context
'when user is signed out'
do
let
(
:group
)
{
public_group
}
context
'when group is public'
do
before_all
do
group
.
update!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
end
it
'does not save visit'
do
it
'does not save visit
for unsigned user
'
do
sign_out
(
user
)
# epic board visits not supported yet
...
...
@@ -159,6 +166,13 @@ RSpec.describe Groups::EpicBoardsController do
subject
{
read_board
board:
board
}
end
it_behaves_like
'tracking unique hll events'
do
subject
(
:request
)
{
read_board
(
board:
board
)
}
let
(
:target_id
)
{
'g_project_management_users_viewing_epic_boards'
}
let
(
:expected_type
)
{
instance_of
(
String
)
}
end
def
read_board
(
board
:,
format: :html
)
get
:show
,
params:
{
group_id:
group
,
...
...
ee/spec/services/boards/epic_boards/create_service_spec.rb
View file @
42de7d2f
...
...
@@ -7,6 +7,8 @@ RSpec.describe Boards::EpicBoards::CreateService, services: true do
service
.
execute
.
payload
end
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:parent
)
{
create
(
:group
)
}
let
(
:epic_boards_enabled
)
{
false
}
...
...
@@ -16,7 +18,7 @@ RSpec.describe Boards::EpicBoards::CreateService, services: true do
context
'with epic boards feature not available'
do
it
'does not create a board'
do
service
=
described_class
.
new
(
parent
,
double
)
service
=
described_class
.
new
(
parent
,
user
)
expect
(
service
.
execute
.
payload
).
not_to
be_nil
expect
{
service
.
execute
}.
not_to
change
(
parent
.
epic_boards
,
:count
)
...
...
@@ -27,5 +29,12 @@ RSpec.describe Boards::EpicBoards::CreateService, services: true do
let
(
:epic_boards_enabled
)
{
true
}
it_behaves_like
'create a board'
,
:epic_boards
it
'tracks epic board creation'
do
expect
(
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
)
.
to
receive
(
:track_event
).
with
(
'g_project_management_users_creating_epic_boards'
,
values:
user
.
id
)
described_class
.
new
(
parent
,
user
).
execute
end
end
end
ee/spec/services/boards/epic_boards/update_service_spec.rb
View file @
42de7d2f
...
...
@@ -29,4 +29,11 @@ RSpec.describe Boards::EpicBoards::UpdateService, services: true do
end
it_behaves_like
'board update service'
it
'tracks epic board name updates'
do
expect
(
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
)
.
to
receive
(
:track_event
).
with
(
'g_project_management_users_updating_epic_board_names'
,
values:
user
.
id
)
described_class
.
new
(
group
,
user
,
name:
'foo'
).
execute
(
board
)
end
end
ee/spec/support/shared_examples/services/boards/create_boards_shared_examples.rb
View file @
42de7d2f
# frozen_string_literal: true
RSpec
.
shared_examples
'create a board'
do
|
scope
|
let_it_be
(
:user
)
{
create
(
:user
)
}
context
'with valid params'
do
subject
(
:service
)
{
described_class
.
new
(
parent
,
double
,
name:
'Backend'
)
}
subject
(
:service
)
{
described_class
.
new
(
parent
,
user
,
name:
'Backend'
)
}
it
'creates a new board'
do
expect
{
service
.
execute
}.
to
change
(
parent
.
send
(
scope
),
:count
).
by
(
1
)
...
...
@@ -22,7 +24,7 @@ RSpec.shared_examples 'create a board' do |scope|
end
context
'with invalid params'
do
subject
(
:service
)
{
described_class
.
new
(
parent
,
double
,
name:
nil
)
}
subject
(
:service
)
{
described_class
.
new
(
parent
,
user
,
name:
nil
)
}
it
'does not create a new parent board'
do
expect
{
service
.
execute
}.
not_to
change
(
parent
.
send
(
scope
),
:count
)
...
...
@@ -38,7 +40,7 @@ RSpec.shared_examples 'create a board' do |scope|
end
context
'without params'
do
subject
(
:service
)
{
described_class
.
new
(
parent
,
double
)
}
subject
(
:service
)
{
described_class
.
new
(
parent
,
user
)
}
it
'creates a new parent board'
do
expect
{
service
.
execute
}.
to
change
(
parent
.
send
(
scope
),
:count
).
by
(
1
)
...
...
lib/gitlab/usage_data_counters/known_events/epic_board_events.yml
0 → 100644
View file @
42de7d2f
# Epic board events
#
# We are using the same slot of issue events 'project_management' for
# epic events to allow data aggregation.
# More information in: https://gitlab.com/gitlab-org/gitlab/-/issues/322405
-
name
:
g_project_management_users_creating_epic_boards
category
:
epic_boards_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epic_boards_activity
-
name
:
g_project_management_users_viewing_epic_boards
category
:
epic_boards_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epic_boards_activity
-
name
:
g_project_management_users_updating_epic_board_names
category
:
epic_boards_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epic_boards_activity
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
View file @
42de7d2f
...
...
@@ -45,6 +45,7 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
'quickactions'
,
'pipeline_authoring'
,
'epics_usage'
,
'epic_boards_usage'
,
'secure'
)
end
...
...
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