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
028f5a4d
Commit
028f5a4d
authored
Mar 24, 2020
by
rpereira2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing docstring to Prometheus metric
parent
244966bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
changelogs/unreleased/rp-add-missing-docstring.yml
changelogs/unreleased/rp-add-missing-docstring.yml
+5
-0
lib/gitlab/middleware/rails_queue_duration.rb
lib/gitlab/middleware/rails_queue_duration.rb
+1
-0
spec/lib/gitlab/middleware/rails_queue_duration_spec.rb
spec/lib/gitlab/middleware/rails_queue_duration_spec.rb
+8
-1
No files found.
changelogs/unreleased/rp-add-missing-docstring.yml
0 → 100644
View file @
028f5a4d
---
title
:
Add missing docstring to Prometheus metric
merge_request
:
27868
author
:
type
:
fixed
lib/gitlab/middleware/rails_queue_duration.rb
View file @
028f5a4d
...
...
@@ -32,6 +32,7 @@ module Gitlab
def
metric_rails_queue_duration_seconds
@metric_rails_queue_duration_seconds
||=
Gitlab
::
Metrics
.
histogram
(
:gitlab_rails_queue_duration_seconds
,
'Measures latency between GitLab Workhorse forwarding a request to Rails'
,
Gitlab
::
Metrics
::
Transaction
::
BASE_LABELS
)
end
...
...
spec/lib/gitlab/middleware/rails_queue_duration_spec.rb
View file @
028f5a4d
...
...
@@ -9,7 +9,7 @@ describe Gitlab::Middleware::RailsQueueDuration do
let
(
:transaction
)
{
Gitlab
::
Metrics
::
WebTransaction
.
new
(
env
)
}
before
do
expect
(
app
).
to
receive
(
:call
).
with
(
env
).
and_return
(
'yay'
)
allow
(
app
).
to
receive
(
:call
).
with
(
env
).
and_return
(
'yay'
)
end
describe
'#call'
do
...
...
@@ -42,6 +42,13 @@ describe Gitlab::Middleware::RailsQueueDuration do
expect
(
middleware
.
call
(
env
)).
to
eq
(
'yay'
)
end
end
it
'creates a metric with a docstring'
do
metric
=
middleware
.
send
(
:metric_rails_queue_duration_seconds
)
expect
(
metric
).
to
be_instance_of
(
Prometheus
::
Client
::
Histogram
)
expect
(
metric
.
docstring
).
to
eq
(
'Measures latency between GitLab Workhorse forwarding a request to Rails'
)
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