Commit 77e938a8 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Avoid using Send (but is it better?) + small rubocop cleanup

parent 19634c25
...@@ -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, name, *args) provide_metric(name) || registry.method(method).call(name, *args)
end end
end end
......
...@@ -5,6 +5,13 @@ ...@@ -5,6 +5,13 @@
module Gitlab module Gitlab
module Middleware module Middleware
class RailsQueueDuration 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) def initialize(app)
@app = app @app = app
end end
...@@ -21,15 +28,6 @@ module Gitlab ...@@ -21,15 +28,6 @@ module Gitlab
@app.call(env) @app.call(env)
end 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 end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment