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
return metric if metric
PROVIDER_MUTEX.synchronize do
provide_metric(name) || registry.send(method, name, *args)
provide_metric(name) || registry.method(method).call(name, *args)
end
end
......
......@@ -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 @@ module Gitlab
@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
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