Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
b0c0ccba38dc
Commit
77e938a8
authored
Sep 07, 2017
by
Pawel Chojnacki
Browse files
Avoid using Send (but is it better?) + small rubocop cleanup
parent
8083555f3b76
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/metrics/prometheus.rb
View file @
b0c0ccba
...
...
@@ -53,7 +53,7 @@ def safe_provide_metric(method, name, *args)
return
metric
if
metric
PROVIDER_MUTEX
.
synchronize
do
provide_metric
(
name
)
||
registry
.
sen
d
(
method
,
name
,
*
args
)
provide_metric
(
name
)
||
registry
.
metho
d
(
method
).
call
(
name
,
*
args
)
end
end
...
...
lib/gitlab/middleware/rails_queue_duration.rb
View file @
b0c0ccba
...
...
@@ -5,6 +5,13 @@
module
Gitlab
module
Middleware
class
RailsQueueDuration
def
self
.
metric_rails_queue_duration_seconds
@metric_rails_queue_duration_seconds
||=
Gitlab
::
Metrics
.
histogram
(
:gitlab_rails_queue_duration_seconds
,
Gitlab
::
Metrics
::
Transaction
::
BASE_LABELS
)
end
def
initialize
(
app
)
@app
=
app
end
...
...
@@ -21,15 +28,6 @@ def call(env)
@app
.
call
(
env
)
end
private
def
self
.
metric_rails_queue_duration_seconds
@metric_rails_queue_duration_seconds
||=
Gitlab
::
Metrics
.
histogram
(
:gitlab_rails_queue_duration_seconds
,
Gitlab
::
Metrics
::
Transaction
::
BASE_LABELS
)
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