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
b67fa5b4
Commit
b67fa5b4
authored
Mar 15, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic destroy note via usage ping
- Add usage ping metrics files
parent
a3bd306a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
115 additions
and
1 deletion
+115
-1
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/services/ee/notes/destroy_service.rb
ee/app/services/ee/notes/destroy_service.rb
+8
-0
ee/changelogs/unreleased/292253-cablett-track-destroy-epic-note.yml
...ogs/unreleased/292253-cablett-track-destroy-epic-note.yml
+5
-0
ee/config/metrics/counts_28d/20210315034808_g_project_management_users_destroying_epic_notes_monthly.yml
...roject_management_users_destroying_epic_notes_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210315034846_g_project_management_users_destroying_epic_notes_weekly.yml
...project_management_users_destroying_epic_notes_weekly.yml
+21
-0
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
...itlab/usage_data_counters/epic_activity_unique_counter.rb
+5
-0
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
.../usage_data_counters/epic_activity_unique_counter_spec.rb
+12
-0
ee/spec/services/ee/notes/destroy_service_spec.rb
ee/spec/services/ee/notes/destroy_service_spec.rb
+12
-0
lib/gitlab/usage_data_counters/known_events/epic_events.yml
lib/gitlab/usage_data_counters/known_events/epic_events.yml
+6
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+1
-1
No files found.
doc/development/usage_ping/dictionary.md
View file @
b67fa5b4
...
@@ -9812,6 +9812,30 @@ Status: `implemented`
...
@@ -9812,6 +9812,30 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_destroying_epic_notes_monthly`
Counts of MAU destroying epic notes
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210315034808_g_project_management_users_destroying_epic_notes_monthly.yml
)
Group:
`group:product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_destroying_epic_notes_weekly`
Counts of WAU destroying epic notes
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210315034846_g_project_management_users_destroying_epic_notes_weekly.yml
)
Group:
`group:product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.ide_edit.g_edit_by_sfe_monthly`
### `redis_hll_counters.ide_edit.g_edit_by_sfe_monthly`
Missing description
Missing description
...
...
ee/app/services/ee/notes/destroy_service.rb
View file @
b67fa5b4
...
@@ -11,6 +11,14 @@ module EE
...
@@ -11,6 +11,14 @@ module EE
::
Analytics
::
RefreshCommentsData
.
for_note
(
note
)
&
.
execute
(
force:
true
)
::
Analytics
::
RefreshCommentsData
.
for_note
(
note
)
&
.
execute
(
force:
true
)
::
Gitlab
::
StatusPage
.
trigger_publish
(
project
,
current_user
,
note
)
::
Gitlab
::
StatusPage
.
trigger_publish
(
project
,
current_user
,
note
)
track_note_removal_usage_epics
if
note
.
for_epic?
end
private
def
track_note_removal_usage_epics
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_note_destroyed_action
(
author:
current_user
)
end
end
end
end
end
end
...
...
ee/changelogs/unreleased/292253-cablett-track-destroy-epic-note.yml
0 → 100644
View file @
b67fa5b4
---
title
:
Track epic note destroyed
merge_request
:
56617
author
:
type
:
other
ee/config/metrics/counts_28d/20210315034808_g_project_management_users_destroying_epic_notes_monthly.yml
0 → 100644
View file @
b67fa5b4
---
# 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_destroying_epic_notes_monthly
description
:
Counts of MAU destroying epic notes
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/56617
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210315034846_g_project_management_users_destroying_epic_notes_weekly.yml
0 → 100644
View file @
b67fa5b4
---
# 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_destroying_epic_notes_weekly
description
:
Counts of WAU destroying epic notes
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/56617
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 @
b67fa5b4
...
@@ -8,12 +8,17 @@ module Gitlab
...
@@ -8,12 +8,17 @@ module Gitlab
# slot of issue events to allow data aggregation.
# slot of issue events to allow data aggregation.
# More information in: https://gitlab.com/gitlab-org/gitlab/-/issues/322405
# More information in: https://gitlab.com/gitlab-org/gitlab/-/issues/322405
EPIC_CREATED
=
'g_project_management_epic_created'
EPIC_CREATED
=
'g_project_management_epic_created'
EPIC_NOTE_DESTROYED
=
'g_project_management_users_destroying_epic_notes'
class
<<
self
class
<<
self
def
track_epic_created_action
(
author
:,
time:
Time
.
zone
.
now
)
def
track_epic_created_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_CREATED
,
author
,
time
)
track_unique_action
(
EPIC_CREATED
,
author
,
time
)
end
end
def
track_epic_note_destroyed_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_NOTE_DESTROYED
,
author
,
time
)
end
private
private
def
track_unique_action
(
action
,
author
,
time
)
def
track_unique_action
(
action
,
author
,
time
)
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
b67fa5b4
...
@@ -19,4 +19,16 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
...
@@ -19,4 +19,16 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
context
'for epic note destroyed event'
do
def
track_action
(
params
)
described_class
.
track_epic_note_destroyed_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_NOTE_DESTROYED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
end
ee/spec/services/ee/notes/destroy_service_spec.rb
View file @
b67fa5b4
...
@@ -31,5 +31,17 @@ RSpec.describe Notes::DestroyService do
...
@@ -31,5 +31,17 @@ RSpec.describe Notes::DestroyService do
include_examples
'trigger status page publish'
include_examples
'trigger status page publish'
end
end
describe
'tracking via usage ping'
do
let_it_be
(
:note
)
do
create
(
:note_on_epic
,
author:
user
)
end
it
'tracks epic note destroy'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_note_destroyed_action
)
service
.
execute
(
note
)
end
end
end
end
end
end
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
b67fa5b4
...
@@ -8,3 +8,9 @@
...
@@ -8,3 +8,9 @@
redis_slot
:
project_management
redis_slot
:
project_management
aggregation
:
daily
aggregation
:
daily
feature_flag
:
track_epics_activity
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_destroying_epic_notes
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
spec/lib/gitlab/usage_data_spec.rb
View file @
b67fa5b4
...
@@ -1358,7 +1358,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -1358,7 +1358,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
let
(
:categories
)
{
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
categories
}
let
(
:categories
)
{
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
categories
}
let
(
:ineligible_total_categories
)
do
let
(
:ineligible_total_categories
)
do
%w[source_code ci_secrets_management incident_management_alerts snippets terraform
epics_usage
]
%w[source_code ci_secrets_management incident_management_alerts snippets terraform]
end
end
it
'has all known_events'
do
it
'has all known_events'
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