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
cc6000a7
Commit
cc6000a7
authored
Mar 15, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic set start date as fixed or inherited via usage ping
- Add usage ping metrics files
parent
a162a0aa
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
213 additions
and
0 deletions
+213
-0
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+48
-0
ee/app/services/epics/update_service.rb
ee/app/services/epics/update_service.rb
+13
-0
ee/changelogs/unreleased/292253-cablett-track-epic-start-date-fixed.yml
...unreleased/292253-cablett-track-epic-start-date-fixed.yml
+5
-0
ee/config/metrics/counts_28d/20210315055439_g_project_management_users_setting_epic_start_date_as_inherited_monthly.yml
...nt_users_setting_epic_start_date_as_inherited_monthly.yml
+21
-0
ee/config/metrics/counts_28d/20210315055624_g_project_management_users_setting_epic_start_date_as_fixed_monthly.yml
...gement_users_setting_epic_start_date_as_fixed_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210315054905_g_project_management_users_setting_epic_start_date_as_fixed_weekly.yml
...agement_users_setting_epic_start_date_as_fixed_weekly.yml
+21
-0
ee/config/metrics/counts_7d/20210315055342_g_project_management_users_setting_epic_start_date_as_inherited_weekly.yml
...ent_users_setting_epic_start_date_as_inherited_weekly.yml
+22
-0
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
...itlab/usage_data_counters/epic_activity_unique_counter.rb
+10
-0
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
.../usage_data_counters/epic_activity_unique_counter_spec.rb
+26
-0
ee/spec/services/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+14
-0
lib/gitlab/usage_data_counters/known_events/epic_events.yml
lib/gitlab/usage_data_counters/known_events/epic_events.yml
+12
-0
No files found.
doc/development/usage_ping/dictionary.md
View file @
cc6000a7
...
...
@@ -9836,6 +9836,54 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_start_date_as_fixed_monthly`
Counts of MAU setting epic start date as fixed
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210315055624_g_project_management_users_setting_epic_start_date_as_fixed_monthly.yml
)
Group:
`group:product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_start_date_as_fixed_weekly`
Counts of WAU setting epic start date as fixed
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210315054905_g_project_management_users_setting_epic_start_date_as_fixed_weekly.yml
)
Group:
`group:product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_start_date_as_inherited_monthly`
Counts of MAU setting epic start date as inherited
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210315055439_g_project_management_users_setting_epic_start_date_as_inherited_monthly.yml
)
Group:
`group:product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_start_date_as_inherited_weekly`
Counts of WAU setting epic start date as inherited
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210315055342_g_project_management_users_setting_epic_start_date_as_inherited_weekly.yml
)
Group:
`group:product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.ide_edit.g_edit_by_sfe_monthly`
Missing description
...
...
ee/app/services/epics/update_service.rb
View file @
cc6000a7
...
...
@@ -18,6 +18,9 @@ module Epics
if
saved_change_to_epic_dates?
(
epic
)
Epics
::
UpdateDatesService
.
new
([
epic
]).
execute
track_start_date_fixed_events
(
epic
)
epic
.
reset
end
...
...
@@ -51,6 +54,16 @@ module Epics
private
def
track_start_date_fixed_events
(
epic
)
return
unless
epic
.
saved_changes
.
key?
(
'start_date_is_fixed'
)
if
epic
.
start_date_is_fixed?
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_start_date_set_as_fixed_action
(
author:
current_user
)
else
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_start_date_set_as_inherited_action
(
author:
current_user
)
end
end
def
saved_change_to_epic_dates?
(
epic
)
(
epic
.
saved_changes
.
keys
.
map
(
&
:to_sym
)
&
EPIC_DATE_FIELDS
).
present?
end
...
...
ee/changelogs/unreleased/292253-cablett-track-epic-start-date-fixed.yml
0 → 100644
View file @
cc6000a7
---
title
:
Track epic start date set to fixed or inherited via usage ping
merge_request
:
56619
author
:
type
:
other
ee/config/metrics/counts_28d/20210315055439_g_project_management_users_setting_epic_start_date_as_inherited_monthly.yml
0 → 100644
View file @
cc6000a7
---
# 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.epics_usage.g_project_management_users_setting_epic_start_date_as_inherited_monthly
description
:
Counts of MAU setting epic start date as inherited
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56619
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_28d/20210315055624_g_project_management_users_setting_epic_start_date_as_fixed_monthly.yml
0 → 100644
View file @
cc6000a7
---
# 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.epics_usage.g_project_management_users_setting_epic_start_date_as_fixed_monthly
description
:
Counts of MAU setting epic start date as fixed
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56619
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210315054905_g_project_management_users_setting_epic_start_date_as_fixed_weekly.yml
0 → 100644
View file @
cc6000a7
---
# 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.epics_usage.g_project_management_users_setting_epic_start_date_as_fixed_weekly
description
:
Counts of WAU setting epic start date as fixed
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56619
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210315055342_g_project_management_users_setting_epic_start_date_as_inherited_weekly.yml
0 → 100644
View file @
cc6000a7
---
# 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.epics_usage.g_project_management_users_setting_epic_start_date_as_inherited_weekly
description
:
Counts of WAU setting epic start date as inherited
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56619
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
View file @
cc6000a7
...
...
@@ -8,6 +8,8 @@ module Gitlab
# slot of issue events to allow data aggregation.
# More information in: https://gitlab.com/gitlab-org/gitlab/-/issues/322405
EPIC_CREATED
=
'g_project_management_epic_created'
EPIC_START_DATE_SET_AS_FIXED
=
'g_project_management_users_setting_epic_start_date_as_fixed'
EPIC_START_DATE_SET_AS_INHERITED
=
'g_project_management_users_setting_epic_start_date_as_inherited'
EPIC_NOTE_DESTROYED
=
'g_project_management_users_destroying_epic_notes'
class
<<
self
...
...
@@ -19,6 +21,14 @@ module Gitlab
track_unique_action
(
EPIC_NOTE_DESTROYED
,
author
,
time
)
end
def
track_epic_start_date_set_as_fixed_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_START_DATE_SET_AS_FIXED
,
author
,
time
)
end
def
track_epic_start_date_set_as_inherited_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_START_DATE_SET_AS_INHERITED
,
author
,
time
)
end
private
def
track_unique_action
(
action
,
author
,
time
)
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
cc6000a7
...
...
@@ -31,4 +31,30 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'for epic date modification events'
do
context
'setting start date as fixed event'
do
def
track_action
(
params
)
described_class
.
track_epic_start_date_set_as_fixed_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_START_DATE_SET_AS_FIXED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'setting start date as inherited event'
do
def
track_action
(
params
)
described_class
.
track_epic_start_date_set_as_inherited_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_START_DATE_SET_AS_INHERITED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
end
ee/spec/services/epics/update_service_spec.rb
View file @
cc6000a7
...
...
@@ -293,6 +293,20 @@ RSpec.describe Epics::UpdateService do
end
end
context
'epic start date fixed or inherited'
do
it
'tracks the user action to set as fixed'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_start_date_set_as_fixed_action
)
update_epic
(
start_date_is_fixed:
true
,
start_date_fixed:
Date
.
today
)
end
it
'tracks the user action to set as inherited'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_start_date_set_as_inherited_action
)
update_epic
(
start_date_is_fixed:
false
)
end
end
context
'date fields are not updated'
do
it
'does not call UpdateDatesService'
do
expect
(
Epics
::
UpdateDatesService
).
not_to
receive
(
:new
)
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
cc6000a7
...
...
@@ -14,3 +14,15 @@
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_setting_epic_start_date_as_fixed
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_setting_epic_start_date_as_inherited
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
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