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
a23fe298
Commit
a23fe298
authored
Jul 28, 2021
by
Phil Hughes
Committed by
Kushal Pandya
Jul 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instrument usage of browser find in diffs
parent
23852b6c
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
142 additions
and
2 deletions
+142
-2
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+9
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
config/feature_flags/development/diff_searching_usage_data.yml
...g/feature_flags/development/diff_searching_usage_data.yml
+8
-0
config/metrics/aggregates/code_review.yml
config/metrics/aggregates/code_review.yml
+2
-0
config/metrics/counts_28d/20210720144005_i_code_review_user_searches_diff_monthly.yml
...210720144005_i_code_review_user_searches_diff_monthly.yml
+21
-0
config/metrics/counts_7d/20210720144005_i_code_review_user_searches_diff_weekly.yml
...0210720144005_i_code_review_user_searches_diff_weekly.yml
+21
-0
config/metrics/counts_all/20210723075525_diff_searches.yml
config/metrics/counts_all/20210723075525_diff_searches.yml
+21
-0
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+42
-0
lib/gitlab/usage_data_counters.rb
lib/gitlab/usage_data_counters.rb
+2
-1
lib/gitlab/usage_data_counters/diffs_counter.rb
lib/gitlab/usage_data_counters/diffs_counter.rb
+10
-0
lib/gitlab/usage_data_counters/known_events/code_review_events.yml
...b/usage_data_counters/known_events/code_review_events.yml
+5
-0
No files found.
app/assets/javascripts/diffs/components/app.vue
View file @
a23fe298
...
@@ -506,7 +506,10 @@ export default {
...
@@ -506,7 +506,10 @@ export default {
);
);
}
}
if
(
window
.
gon
?.
features
?.
diffsVirtualScrolling
)
{
if
(
window
.
gon
?.
features
?.
diffsVirtualScrolling
||
window
.
gon
?.
features
?.
diffSearchingUsageData
)
{
let
keydownTime
;
let
keydownTime
;
Mousetrap
.
bind
([
'
mod+f
'
,
'
mod+g
'
],
()
=>
{
Mousetrap
.
bind
([
'
mod+f
'
,
'
mod+g
'
],
()
=>
{
keydownTime
=
new
Date
().
getTime
();
keydownTime
=
new
Date
().
getTime
();
...
@@ -520,6 +523,11 @@ export default {
...
@@ -520,6 +523,11 @@ export default {
// and max 1000ms to be sure it the search box is filtered
// and max 1000ms to be sure it the search box is filtered
if
(
delta
>=
0
&&
delta
<
1000
)
{
if
(
delta
>=
0
&&
delta
<
1000
)
{
this
.
disableVirtualScroller
=
true
;
this
.
disableVirtualScroller
=
true
;
if
(
window
.
gon
?.
features
?.
diffSearchingUsageData
)
{
api
.
trackRedisHllUserEvent
(
'
i_code_review_user_searches_diff
'
);
api
.
trackRedisCounterEvent
(
'
user_searches_diffs
'
);
}
}
}
}
}
});
});
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
a23fe298
...
@@ -44,6 +44,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
...
@@ -44,6 +44,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
# Usage data feature flags
# Usage data feature flags
push_frontend_feature_flag
(
:users_expanding_widgets_usage_data
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:users_expanding_widgets_usage_data
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:diff_settings_usage_data
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:diff_settings_usage_data
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:diff_searching_usage_data
,
@project
,
default_enabled: :yaml
)
experiment
(
:invite_members_in_comment
,
namespace:
@project
.
root_ancestor
)
do
|
experiment_instance
|
experiment
(
:invite_members_in_comment
,
namespace:
@project
.
root_ancestor
)
do
|
experiment_instance
|
experiment_instance
.
exclude!
unless
helpers
.
can_import_members?
experiment_instance
.
exclude!
unless
helpers
.
can_import_members?
...
...
config/feature_flags/development/diff_searching_usage_data.yml
0 → 100644
View file @
a23fe298
---
name
:
diff_searching_usage_data
introduced_by_url
:
rollout_issue_url
:
milestone
:
'
14.2'
type
:
development
group
:
group::code review
default_enabled
:
true
config/metrics/aggregates/code_review.yml
View file @
a23fe298
...
@@ -65,6 +65,7 @@
...
@@ -65,6 +65,7 @@
-
'
i_code_review_diff_multiple_files'
-
'
i_code_review_diff_multiple_files'
-
'
i_code_review_user_load_conflict_ui'
-
'
i_code_review_user_load_conflict_ui'
-
'
i_code_review_user_resolve_conflict'
-
'
i_code_review_user_resolve_conflict'
-
'
i_code_review_user_searches_diff'
-
name
:
code_review_category_monthly_active_users
-
name
:
code_review_category_monthly_active_users
operator
:
OR
operator
:
OR
source
:
redis
source
:
redis
...
@@ -122,6 +123,7 @@
...
@@ -122,6 +123,7 @@
-
'
i_code_review_diff_multiple_files'
-
'
i_code_review_diff_multiple_files'
-
'
i_code_review_user_load_conflict_ui'
-
'
i_code_review_user_load_conflict_ui'
-
'
i_code_review_user_resolve_conflict'
-
'
i_code_review_user_resolve_conflict'
-
'
i_code_review_user_searches_diff'
-
name
:
code_review_extension_category_monthly_active_users
-
name
:
code_review_extension_category_monthly_active_users
operator
:
OR
operator
:
OR
source
:
redis
source
:
redis
...
...
config/metrics/counts_28d/20210720144005_i_code_review_user_searches_diff_monthly.yml
0 → 100644
View file @
a23fe298
---
key_path
:
redis_hll_counters.code_review.i_code_review_user_searches_diff_monthly
description
:
Count of users who search merge request diffs
product_section
:
dev
product_stage
:
create
product_group
:
group::code review
product_category
:
code_review
value_type
:
number
status
:
implemented
milestone
:
'
14.2'
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66522
time_frame
:
28d
data_source
:
redis_hll
data_category
:
Optional
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
config/metrics/counts_7d/20210720144005_i_code_review_user_searches_diff_weekly.yml
0 → 100644
View file @
a23fe298
---
key_path
:
redis_hll_counters.code_review.i_code_review_user_searches_diff_weekly
description
:
Count of users who search merge request diffs
product_section
:
dev
product_stage
:
create
product_group
:
group::code review
product_category
:
code_review
value_type
:
number
status
:
implemented
milestone
:
'
14.2'
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66522
time_frame
:
7d
data_source
:
redis_hll
data_category
:
Optional
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
config/metrics/counts_all/20210723075525_diff_searches.yml
0 → 100644
View file @
a23fe298
---
key_path
:
counts.diff_searches
description
:
Total count of merge request diff searches
product_section
:
dev
product_stage
:
create
product_group
:
group::code review
product_category
:
code_review
value_type
:
number
status
:
implemented
milestone
:
'
14.2'
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66522
time_frame
:
all
data_source
:
redis
data_category
:
Optional
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
doc/development/usage_ping/dictionary.md
View file @
a23fe298
...
@@ -7650,6 +7650,20 @@ Status: `data_available`
...
@@ -7650,6 +7650,20 @@ Status: `data_available`
Tiers:
`free`
,
`premium`
,
`ultimate`
Tiers:
`free`
,
`premium`
,
`ultimate`
### `counts.user_searches_diffs`
Count of users who search merge request diffs
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210723075525_user_searches_diffs.yml
)
Group:
`group::code review`
Data Category:
`Optional`
Status:
`implemented`
Tiers:
`free`
,
`premium`
,
`ultimate`
### `counts.web_hooks`
### `counts.web_hooks`
Missing description
Missing description
...
@@ -10646,6 +10660,20 @@ Status: `data_available`
...
@@ -10646,6 +10660,20 @@ Status: `data_available`
Tiers: `free`, `premium`, `ultimate`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.code_review.i_code_review_searches_in_diff_monthly`
Count of searches in merge request diffs
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210722132444_i_code_review_searches_in_diff_monthly.yml)
Group: `group::code review`
Data Category: `Optional`
Status: `implemented`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.code_review.i_code_review_user_add_suggestion_monthly`
### `redis_hll_counters.code_review.i_code_review_user_add_suggestion_monthly`
Count of unique users per month who added a suggestion
Count of unique users per month who added a suggestion
...
@@ -11514,6 +11542,20 @@ Status: `data_available`
...
@@ -11514,6 +11542,20 @@ Status: `data_available`
Tiers: `free`, `premium`, `ultimate`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.code_review.i_code_review_user_searches_diff_monthly`
Count of users who search merge request diffs
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210720144005_i_code_review_user_searches_diff_monthly.yml)
Group: `group::code review`
Data Category: `Optional`
Status: `implemented`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.code_review.i_code_review_user_single_file_diffs_monthly`
### `redis_hll_counters.code_review.i_code_review_user_single_file_diffs_monthly`
Count of unique users per month with diffs viewed file by file
Count of unique users per month with diffs viewed file by file
...
...
lib/gitlab/usage_data_counters.rb
View file @
a23fe298
...
@@ -15,7 +15,8 @@ module Gitlab
...
@@ -15,7 +15,8 @@ module Gitlab
MergeRequestCounter
,
MergeRequestCounter
,
DesignsCounter
,
DesignsCounter
,
KubernetesAgentCounter
,
KubernetesAgentCounter
,
StaticSiteEditorCounter
StaticSiteEditorCounter
,
DiffsCounter
].
freeze
].
freeze
UsageDataCounterError
=
Class
.
new
(
StandardError
)
UsageDataCounterError
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/usage_data_counters/diffs_counter.rb
0 → 100644
View file @
a23fe298
# frozen_string_literal: true
module
Gitlab
module
UsageDataCounters
class
DiffsCounter
<
BaseCounter
KNOWN_EVENTS
=
%w[searches]
.
freeze
PREFIX
=
'diff'
end
end
end
lib/gitlab/usage_data_counters/known_events/code_review_events.yml
View file @
a23fe298
...
@@ -232,3 +232,8 @@
...
@@ -232,3 +232,8 @@
redis_slot
:
code_review
redis_slot
:
code_review
category
:
code_review
category
:
code_review
aggregation
:
weekly
aggregation
:
weekly
-
name
:
i_code_review_user_searches_diff
redis_slot
:
code_review
category
:
code_review
aggregation
:
weekly
feature_flag
:
diff_searching_usage_data
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