Skip to content
Snippets Groups Projects
Commit cee07c59 authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Measure proxy timing: needs influxdb code

parent baa9c660
No related branches found
No related tags found
No related merge requests found
Rails.application.config.middleware.use(Gitlab::Middleware::ProxyTiming)
# This Rack middleware is intended to measure the latency between
# gitlab-workhorse forwarding a request to the Rails application and the
# time this middleware is reached.
module Gitlab
module Middleware
class ProxyTiming
def initialize(app)
@app = app
end
def call(env)
proxy_start = env['HTTP_GITLAB_WORHORSE_PROXY_START'].to_f / 1_000_000_000
if proxy_start > 0
# send measurement
puts "\n\n\n#{(Time.now - proxy_start).to_f}\n\n\n"
end
@app.call(env)
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment