summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/initializers/metrics.rb2
-rw-r--r--lib/gitlab/middleware/rails_queue_duration.rb (renamed from lib/gitlab/middleware/proxy_flight_time.rb)4
-rw-r--r--spec/lib/gitlab/middleware/rails_queue_duration_spec.rb (renamed from spec/lib/gitlab/middleware/proxy_flight_time_spec.rb)4
3 files changed, 5 insertions, 5 deletions
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index 540e10c1ec1..0c788714714 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -12,7 +12,7 @@ if Gitlab::Metrics.enabled?
Gitlab::Application.configure do |config|
config.middleware.use(Gitlab::Metrics::RackMiddleware)
- config.middleware.use(Gitlab::Middleware::ProxyFlightTime)
+ config.middleware.use(Gitlab::Middleware::RailsQueueDuration)
end
Sidekiq.configure_server do |config|
diff --git a/lib/gitlab/middleware/proxy_flight_time.rb b/lib/gitlab/middleware/rails_queue_duration.rb
index 042bcdacf8b..56608b1b276 100644
--- a/lib/gitlab/middleware/proxy_flight_time.rb
+++ b/lib/gitlab/middleware/rails_queue_duration.rb
@@ -4,7 +4,7 @@
module Gitlab
module Middleware
- class ProxyFlightTime
+ class RailsQueueDuration
def initialize(app)
@app = app
end
@@ -14,7 +14,7 @@ module Gitlab
proxy_start = env['HTTP_GITLAB_WORHORSE_PROXY_START'].presence
if trans && proxy_start
# Time in milliseconds since gitlab-workhorse started the request
- trans.set(:proxy_flight_time, Time.now.to_f * 1_000 - proxy_start.to_f / 1_000_000)
+ trans.set(:rails_queue_duration, Time.now.to_f * 1_000 - proxy_start.to_f / 1_000_000)
end
@app.call(env)
diff --git a/spec/lib/gitlab/middleware/proxy_flight_time_spec.rb b/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb
index f59166d5c29..fd6f684db0c 100644
--- a/spec/lib/gitlab/middleware/proxy_flight_time_spec.rb
+++ b/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Gitlab::Middleware::ProxyFlightTime do
+describe Gitlab::Middleware::RailsQueueDuration do
let(:app) { double(:app) }
let(:middleware) { described_class.new(app) }
let(:env) { {} }
@@ -23,7 +23,7 @@ describe Gitlab::Middleware::ProxyFlightTime do
it 'sets proxy_flight_time and calls the app when the header is present' do
env['HTTP_GITLAB_WORHORSE_PROXY_START'] = '123'
- expect(transaction).to receive(:set).with(:proxy_flight_time, an_instance_of(Float))
+ expect(transaction).to receive(:set).with(:rails_queue_duration, an_instance_of(Float))
expect(middleware.call(env)).to eq('yay')
end
end