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
02755a3e
Commit
02755a3e
authored
Apr 23, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CountUsersUsingApproveQuickActionMetric to usage data
parent
cfdd2aca
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
4 deletions
+39
-4
config/metrics/counts_28d/20210216181508_i_quickactions_approve_monthly.yml
...nts_28d/20210216181508_i_quickactions_approve_monthly.yml
+2
-1
config/metrics/counts_7d/20210216181506_i_quickactions_approve_weekly.yml
...ounts_7d/20210216181506_i_quickactions_approve_weekly.yml
+3
-2
lib/gitlab/usage/metrics/instrumentations/count_users_using_approve_quick_action_metric.rb
...ntations/count_users_using_approve_quick_action_metric.rb
+13
-0
lib/gitlab/usage/metrics/instrumentations/redis_hll_metric.rb
...gitlab/usage/metrics/instrumentations/redis_hll_metric.rb
+1
-1
spec/lib/gitlab/usage/metrics/instrumentations/count_users_using_approve_quick_action_metric_spec.rb
...ons/count_users_using_approve_quick_action_metric_spec.rb
+15
-0
spec/lib/gitlab/usage_data_metrics_spec.rb
spec/lib/gitlab/usage_data_metrics_spec.rb
+5
-0
No files found.
config/metrics/counts_28d/20210216181508_i_quickactions_approve_monthly.yml
View file @
02755a3e
...
@@ -9,9 +9,10 @@ value_type: number
...
@@ -9,9 +9,10 @@ value_type: number
status
:
data_available
status
:
data_available
time_frame
:
28d
time_frame
:
28d
data_source
:
redis_hll
data_source
:
redis_hll
instrumentation_class
:
'
Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric'
distribution
:
distribution
:
-
ce
-
ce
-
ee
-
ee
tier
:
tier
:
-
free
-
free
-
premium
-
premium
...
...
config/metrics/counts_7d/20210216181506_i_quickactions_approve_weekly.yml
View file @
02755a3e
...
@@ -9,10 +9,11 @@ value_type: number
...
@@ -9,10 +9,11 @@ value_type: number
status
:
data_available
status
:
data_available
time_frame
:
7d
time_frame
:
7d
data_source
:
redis_hll
data_source
:
redis_hll
instrumentation_class
:
'
Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric'
distribution
:
distribution
:
-
ce
-
ce
-
ee
-
ee
tier
:
tier
:
-
free
-
free
-
premium
-
premium
-
ultimate
-
ultimate
\ No newline at end of file
lib/gitlab/usage/metrics/instrumentations/count_users_using_approve_quick_action_metric.rb
0 → 100644
View file @
02755a3e
# frozen_string_literal: true
module
Gitlab
module
Usage
module
Metrics
module
Instrumentations
class
CountUsersUsingApproveQuickActionMetric
<
RedisHLLMetric
event_names
:i_quickactions_approve
end
end
end
end
end
lib/gitlab/usage/metrics/instrumentations/redis_hll_metric.rb
View file @
02755a3e
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
# end
# end
class
<<
self
class
<<
self
def
event_names
(
events
=
nil
)
def
event_names
(
events
=
nil
)
@me
n
tric_events
=
events
@metric_events
=
events
end
end
attr_reader
:metric_events
attr_reader
:metric_events
...
...
spec/lib/gitlab/usage/metrics/instrumentations/count_users_using_approve_quick_action_metric_spec.rb
0 → 100644
View file @
02755a3e
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
CountUsersUsingApproveQuickActionMetric
,
:clean_gitlab_redis_shared_state
do
before
do
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
track_event
(
:i_quickactions_approve
,
values:
1
,
time:
1
.
week
.
ago
)
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
track_event
(
:i_quickactions_approve
,
values:
1
,
time:
2
.
weeks
.
ago
)
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
track_event
(
:i_quickactions_approve
,
values:
2
,
time:
2
.
weeks
.
ago
)
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
track_event
(
:i_quickactions_approve
,
values:
2
,
time:
2
.
months
.
ago
)
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'28d'
,
data_source:
'redis_hll'
},
2
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'7d'
,
data_source:
'redis_hll'
},
1
end
spec/lib/gitlab/usage_data_metrics_spec.rb
View file @
02755a3e
...
@@ -20,6 +20,11 @@ RSpec.describe Gitlab::UsageDataMetrics do
...
@@ -20,6 +20,11 @@ RSpec.describe Gitlab::UsageDataMetrics do
it
'includes top level keys'
do
it
'includes top level keys'
do
expect
(
subject
).
to
include
(
:uuid
)
expect
(
subject
).
to
include
(
:uuid
)
end
end
it
'includes i_quickactions_approve monthly and weekly key'
do
expect
(
subject
[
:redis_hll_counters
][
:quickactions
]).
to
include
(
:i_quickactions_approve_monthly
)
expect
(
subject
[
:redis_hll_counters
][
:quickactions
]).
to
include
(
:i_quickactions_approve_weekly
)
end
end
end
end
end
end
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