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
a3bf2c99
Commit
a3bf2c99
authored
Jul 09, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method to instrumentation
parent
5c4defb5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/usage/metrics/instrumentations/base_metric.rb
lib/gitlab/usage/metrics/instrumentations/base_metric.rb
+1
-1
lib/gitlab/usage/metrics/instrumentations/database_metric.rb
lib/gitlab/usage/metrics/instrumentations/database_metric.rb
+1
-1
lib/gitlab/usage_data_non_sql_metrics.rb
lib/gitlab/usage_data_non_sql_metrics.rb
+1
-1
lib/gitlab/usage_data_queries.rb
lib/gitlab/usage_data_queries.rb
+1
-1
spec/lib/gitlab/usage_data_non_sql_metrics_spec.rb
spec/lib/gitlab/usage_data_non_sql_metrics_spec.rb
+1
-1
spec/lib/gitlab/usage_data_queries_spec.rb
spec/lib/gitlab/usage_data_queries_spec.rb
+1
-1
No files found.
lib/gitlab/usage/metrics/instrumentations/base_metric.rb
View file @
a3bf2c99
...
...
@@ -16,7 +16,7 @@ module Gitlab
@options
=
options
end
def
for_data_warehouse
def
instrumentation
value
end
end
...
...
lib/gitlab/usage/metrics/instrumentations/database_metric.rb
View file @
a3bf2c99
...
...
@@ -59,7 +59,7 @@ module Gitlab
Gitlab
::
Usage
::
Metrics
::
Query
.
for
(
self
.
class
.
metric_operation
,
relation
,
self
.
class
.
column
)
end
def
for_data_warehouse
def
instrumentation
to_sql
end
...
...
lib/gitlab/usage_data_non_sql_metrics.rb
View file @
a3bf2c99
...
...
@@ -6,7 +6,7 @@ module Gitlab
class
<<
self
def
add_metric
(
metric
)
metric
.
for_data_warehouse
metric
.
instrumentation
end
def
count
(
relation
,
column
=
nil
,
batch:
true
,
batch_size:
nil
,
start:
nil
,
finish:
nil
)
...
...
lib/gitlab/usage_data_queries.rb
View file @
a3bf2c99
...
...
@@ -6,7 +6,7 @@ module Gitlab
class
UsageDataQueries
<
UsageData
class
<<
self
def
add_metric
(
metric
)
metric
.
for_data_warehouse
metric
.
instrumentation
end
def
count
(
relation
,
column
=
nil
,
*
args
,
**
kwargs
)
...
...
spec/lib/gitlab/usage_data_non_sql_metrics_spec.rb
View file @
a3bf2c99
...
...
@@ -6,7 +6,7 @@ RSpec.describe Gitlab::UsageDataNonSqlMetrics do
let
(
:default_count
)
{
Gitlab
::
UsageDataNonSqlMetrics
::
SQL_METRIC_DEFAULT
}
describe
'#add_metric'
do
let
(
:metric
)
{
double
(
:metric
,
for_data_warehouse
:
1
)
}
let
(
:metric
)
{
double
(
:metric
,
instrumentation
:
1
)
}
it
'computes the metric value for given metric'
do
expect
(
described_class
.
add_metric
(
metric
)).
to
eq
(
1
)
...
...
spec/lib/gitlab/usage_data_queries_spec.rb
View file @
a3bf2c99
...
...
@@ -8,7 +8,7 @@ RSpec.describe Gitlab::UsageDataQueries do
end
describe
'#add_metric'
do
let
(
:metric
)
{
double
(
:metric
,
for_data_warehouse
:
'SELECT COUNT("users"."id") FROM "users"'
)
}
let
(
:metric
)
{
double
(
:metric
,
instrumentation
:
'SELECT COUNT("users"."id") FROM "users"'
)
}
it
'computes the metric value for given metric'
do
expect
(
described_class
.
add_metric
(
metric
)).
to
eq
(
'SELECT COUNT("users"."id") FROM "users"'
)
...
...
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