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
872d67b9
Commit
872d67b9
authored
Jun 02, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add metric operation to generic and redis_hll metrics
parent
00622aef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
lib/gitlab/usage/metrics/instrumentations/database_metric.rb
lib/gitlab/usage/metrics/instrumentations/database_metric.rb
+1
-5
lib/gitlab/usage/metrics/instrumentations/generic_metric.rb
lib/gitlab/usage/metrics/instrumentations/generic_metric.rb
+4
-3
lib/gitlab/usage/metrics/instrumentations/redis_hll_metric.rb
...gitlab/usage/metrics/instrumentations/redis_hll_metric.rb
+6
-3
No files found.
lib/gitlab/usage/metrics/instrumentations/database_metric.rb
View file @
872d67b9
1
# frozen_string_literal: true
# frozen_string_literal: true
module
Gitlab
module
Gitlab
module
Usage
module
Usage
...
@@ -55,10 +55,6 @@ module Gitlab
...
@@ -55,10 +55,6 @@ module Gitlab
)
)
end
end
def
relation
self
.
class
.
metric_relation
.
call
.
where
(
time_constraints
)
end
private
private
def
relation
def
relation
...
...
lib/gitlab/usage/metrics/instrumentations/generic_metric.rb
View file @
872d67b9
...
@@ -13,6 +13,9 @@ module Gitlab
...
@@ -13,6 +13,9 @@ module Gitlab
# end
# end
# end
# end
class
<<
self
class
<<
self
attr_reader
:metric_operation
@metric_operation
=
:alt
def
value
(
&
block
)
def
value
(
&
block
)
@metric_value
=
block
@metric_value
=
block
end
end
...
@@ -28,9 +31,7 @@ module Gitlab
...
@@ -28,9 +31,7 @@ module Gitlab
def
suggested_name
def
suggested_name
Gitlab
::
Usage
::
Metrics
::
NameSuggestion
.
for
(
Gitlab
::
Usage
::
Metrics
::
NameSuggestion
.
for
(
:alt
,
self
.
class
.
metric_operation
relation:
nil
,
column:
nil
)
)
end
end
end
end
...
...
lib/gitlab/usage/metrics/instrumentations/redis_hll_metric.rb
View file @
872d67b9
...
@@ -12,6 +12,11 @@ module Gitlab
...
@@ -12,6 +12,11 @@ module Gitlab
# events:
# events:
# - g_analytics_valuestream
# - g_analytics_valuestream
# end
# end
class
<<
self
attr_reader
:metric_operation
@metric_operation
=
:redis
end
def
initialize
(
time_frame
:,
options:
{})
def
initialize
(
time_frame
:,
options:
{})
super
super
...
@@ -32,9 +37,7 @@ module Gitlab
...
@@ -32,9 +37,7 @@ module Gitlab
def
suggested_name
def
suggested_name
Gitlab
::
Usage
::
Metrics
::
NameSuggestion
.
for
(
Gitlab
::
Usage
::
Metrics
::
NameSuggestion
.
for
(
:redis
,
self
.
class
.
metric_operation
relation:
nil
,
column:
nil
)
)
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