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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
da912c8f
Commit
da912c8f
authored
Jan 07, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'revert-influxdb-milliseconds' into 'master'
See merge request !2326
parents
0deeebc1
7ed3a5a2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
14 deletions
+6
-14
lib/gitlab/metrics/subscribers/action_view.rb
lib/gitlab/metrics/subscribers/action_view.rb
+2
-6
lib/gitlab/metrics/subscribers/active_record.rb
lib/gitlab/metrics/subscribers/active_record.rb
+1
-5
spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
+2
-2
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
+1
-1
No files found.
lib/gitlab/metrics/subscribers/action_view.rb
View file @
da912c8f
...
...
@@ -19,7 +19,7 @@ module Gitlab
values
=
values_for
(
event
)
tags
=
tags_for
(
event
)
current_transaction
.
increment
(
:view_duration
,
duration
(
event
)
)
current_transaction
.
increment
(
:view_duration
,
event
.
duration
)
current_transaction
.
add_metric
(
SERIES
,
values
,
tags
)
end
...
...
@@ -28,7 +28,7 @@ module Gitlab
end
def
values_for
(
event
)
{
duration:
duration
(
event
)
}
{
duration:
event
.
duration
}
end
def
tags_for
(
event
)
...
...
@@ -48,10 +48,6 @@ module Gitlab
def
current_transaction
Transaction
.
current
end
def
duration
(
event
)
event
.
duration
*
1000.0
end
end
end
end
...
...
lib/gitlab/metrics/subscribers/active_record.rb
View file @
da912c8f
...
...
@@ -8,7 +8,7 @@ module Gitlab
def
sql
(
event
)
return
unless
current_transaction
current_transaction
.
increment
(
:sql_duration
,
duration
(
event
)
)
current_transaction
.
increment
(
:sql_duration
,
event
.
duration
)
end
private
...
...
@@ -16,10 +16,6 @@ module Gitlab
def
current_transaction
Transaction
.
current
end
def
duration
(
event
)
event
.
duration
*
1000.0
end
end
end
end
...
...
spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
View file @
da912c8f
...
...
@@ -21,7 +21,7 @@ describe Gitlab::Metrics::Subscribers::ActionView do
describe
'#render_template'
do
it
'tracks rendering of a template'
do
values
=
{
duration:
2
100
}
values
=
{
duration:
2
.1
}
tags
=
{
view:
'app/views/x.html.haml'
,
file:
'app/views/x.html.haml'
,
...
...
@@ -29,7 +29,7 @@ describe Gitlab::Metrics::Subscribers::ActionView do
}
expect
(
transaction
).
to
receive
(
:increment
).
with
(
:view_duration
,
2
100
)
with
(
:view_duration
,
2
.1
)
expect
(
transaction
).
to
receive
(
:add_metric
).
with
(
described_class
::
SERIES
,
values
,
tags
)
...
...
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
View file @
da912c8f
...
...
@@ -26,7 +26,7 @@ describe Gitlab::Metrics::Subscribers::ActiveRecord do
and_return
(
transaction
)
expect
(
transaction
).
to
receive
(
:increment
).
with
(
:sql_duration
,
200
)
with
(
:sql_duration
,
0.2
)
subscriber
.
sql
(
event
)
end
...
...
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