Commit 3c785a76 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Send data to InfluxDB instead of stdout

parent 897273d1
......@@ -10,11 +10,13 @@ module Gitlab
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"
trans = Gitlab::Metrics.current_transaction
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)
end
@app.call(env)
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