Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
3c785a76
Commit
3c785a76
authored
8 years ago
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send data to InfluxDB instead of stdout
parent
897273d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
lib/gitlab/middleware/proxy_timing.rb
lib/gitlab/middleware/proxy_timing.rb
+6
-4
No files found.
lib/gitlab/middleware/proxy_timing.rb
View file @
3c785a76
...
@@ -10,11 +10,13 @@ module Gitlab
...
@@ -10,11 +10,13 @@ module Gitlab
end
end
def
call
(
env
)
def
call
(
env
)
proxy_start
=
env
[
'HTTP_GITLAB_WORHORSE_PROXY_START'
].
to_f
/
1_000_000_000
trans
=
Gitlab
::
Metrics
.
current_transaction
if
proxy_start
>
0
proxy_start
=
env
[
'HTTP_GITLAB_WORHORSE_PROXY_START'
].
presence
# send measurement
if
trans
&&
proxy_start
puts
"
\n\n\n
#{
(
Time
.
now
-
proxy_start
).
to_f
}
\n\n\n
"
# 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
end
@app
.
call
(
env
)
@app
.
call
(
env
)
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment