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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
c361c1e8
Commit
c361c1e8
authored
Sep 07, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust test to changed metrics methods.
+ remove deprecated test suite
parent
95a23d24
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
18 deletions
+4
-18
lib/gitlab/metrics/prometheus.rb
lib/gitlab/metrics/prometheus.rb
+1
-1
spec/lib/gitlab/metrics/rack_middleware_spec.rb
spec/lib/gitlab/metrics/rack_middleware_spec.rb
+0
-14
spec/lib/gitlab/metrics_spec.rb
spec/lib/gitlab/metrics_spec.rb
+3
-3
No files found.
lib/gitlab/metrics/prometheus.rb
View file @
c361c1e8
...
@@ -53,7 +53,7 @@ module Gitlab
...
@@ -53,7 +53,7 @@ module Gitlab
return
metric
if
metric
return
metric
if
metric
PROVIDER_MUTEX
.
synchronize
do
PROVIDER_MUTEX
.
synchronize
do
provide_metric
(
name
)
||
registry
.
send
(
method
,
*
args
)
provide_metric
(
name
)
||
registry
.
send
(
method
,
name
,
*
args
)
end
end
end
end
...
...
spec/lib/gitlab/metrics/rack_middleware_spec.rb
View file @
c361c1e8
...
@@ -18,20 +18,6 @@ describe Gitlab::Metrics::RackMiddleware do
...
@@ -18,20 +18,6 @@ describe Gitlab::Metrics::RackMiddleware do
expect
(
middleware
.
call
(
env
)).
to
eq
(
'yay'
)
expect
(
middleware
.
call
(
env
)).
to
eq
(
'yay'
)
end
end
xit
'tags a transaction with the name and action of a controller'
do
klass
=
double
(
:klass
,
name:
'TestController'
)
controller
=
double
(
:controller
,
class:
klass
,
action_name:
'show'
,
content_type:
'text/html'
)
env
[
'action_controller.instance'
]
=
controller
allow
(
app
).
to
receive
(
:call
).
with
(
env
)
expect
(
middleware
).
to
receive
(
:tag_controller
)
.
with
(
an_instance_of
(
Gitlab
::
Metrics
::
Transaction
),
env
)
middleware
.
call
(
env
)
end
it
'tracks any raised exceptions'
do
it
'tracks any raised exceptions'
do
expect
(
app
).
to
receive
(
:call
).
with
(
env
).
and_raise
(
RuntimeError
)
expect
(
app
).
to
receive
(
:call
).
with
(
env
).
and_raise
(
RuntimeError
)
...
...
spec/lib/gitlab/metrics_spec.rb
View file @
c361c1e8
...
@@ -199,7 +199,7 @@ describe Gitlab::Metrics do
...
@@ -199,7 +199,7 @@ describe Gitlab::Metrics do
shared_examples
'prometheus metrics API'
do
shared_examples
'prometheus metrics API'
do
describe
'#counter'
do
describe
'#counter'
do
subject
{
described_class
.
counter
(
:couter
,
'doc'
)
}
subject
{
described_class
.
counter
(
:cou
n
ter
,
'doc'
)
}
describe
'#increment'
do
describe
'#increment'
do
it
'successfully calls #increment without arguments'
do
it
'successfully calls #increment without arguments'
do
...
@@ -255,7 +255,7 @@ describe Gitlab::Metrics do
...
@@ -255,7 +255,7 @@ describe Gitlab::Metrics do
it_behaves_like
'prometheus metrics API'
it_behaves_like
'prometheus metrics API'
describe
'#null_metric'
do
describe
'#null_metric'
do
subject
{
described_class
.
provide_metric
(
:test
)
}
subject
{
described_class
.
send
(
:provide_metric
,
:test
)
}
it
{
is_expected
.
to
be_a
(
Gitlab
::
Metrics
::
NullMetric
)
}
it
{
is_expected
.
to
be_a
(
Gitlab
::
Metrics
::
NullMetric
)
}
end
end
...
@@ -296,7 +296,7 @@ describe Gitlab::Metrics do
...
@@ -296,7 +296,7 @@ describe Gitlab::Metrics do
it_behaves_like
'prometheus metrics API'
it_behaves_like
'prometheus metrics API'
describe
'#null_metric'
do
describe
'#null_metric'
do
subject
{
described_class
.
provide_metric
(
:test
)
}
subject
{
described_class
.
send
(
:provide_metric
,
:test
)
}
it
{
is_expected
.
to
be_nil
}
it
{
is_expected
.
to
be_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