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
cc7997d8
Commit
cc7997d8
authored
Sep 06, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More parsable labels in method performance measurements
parent
43a9777e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
lib/gitlab/metrics/method_call.rb
lib/gitlab/metrics/method_call.rb
+6
-6
lib/gitlab/metrics/transaction.rb
lib/gitlab/metrics/transaction.rb
+1
-1
No files found.
lib/gitlab/metrics/method_call.rb
View file @
cc7997d8
...
...
@@ -8,7 +8,7 @@ module Gitlab
@call_real_duration_histogram
||=
Gitlab
::
Metrics
.
histogram
(
:gitlab_method_call_real_duration_seconds
,
'Method calls real duration'
,
{
action:
nil
,
call_name:
nil
}
,
Transaction
::
BASE_LABELS
.
merge
({
call_name:
nil
})
,
[
0.1
,
0.2
,
0.5
,
1
,
2
,
5
,
10
]
)
end
...
...
@@ -17,7 +17,7 @@ module Gitlab
@call_duration_histogram
||=
Gitlab
::
Metrics
.
histogram
(
:gitlab_method_call_cpu_duration_seconds
,
'Method calls cpu duration'
,
{
action:
nil
,
call_name:
nil
}
,
Transaction
::
BASE_LABELS
.
merge
({
call_name:
nil
})
,
[
0.1
,
0.2
,
0.5
,
1
,
2
,
5
,
10
]
)
end
...
...
@@ -25,8 +25,8 @@ module Gitlab
# name - The full name of the method (including namespace) such as
# `User#sign_in`.
#
def
initialize
(
name
,
action
)
@
action
=
action
def
initialize
(
name
,
trans
action
)
@
transaction
=
trans
action
@name
=
name
@real_time
=
0
@cpu_time
=
0
...
...
@@ -44,8 +44,8 @@ module Gitlab
@call_count
+=
1
if
above_threshold?
self
.
class
.
call_real_duration_histogram
.
observe
(
{
call_name:
@name
,
action:
@action
}
,
@real_time
/
1000.0
)
self
.
class
.
call_cpu_duration_histogram
.
observe
(
{
call_name:
@name
,
action:
@action
}
,
@cpu_time
/
1000.0
)
self
.
class
.
call_real_duration_histogram
.
observe
(
@transaction
.
labels
.
merge
({
call_name:
@name
})
,
@real_time
/
1000.0
)
self
.
class
.
call_cpu_duration_histogram
.
observe
(
@transaction
.
labels
.
merge
({
call_name:
@name
})
,
@cpu_time
/
1000.0
)
end
retval
...
...
lib/gitlab/metrics/transaction.rb
View file @
cc7997d8
...
...
@@ -107,7 +107,7 @@ module Gitlab
# Returns a MethodCall object for the given name.
def
method_call_for
(
name
)
unless
method
=
@methods
[
name
]
@methods
[
name
]
=
method
=
MethodCall
.
new
(
name
,
action
)
@methods
[
name
]
=
method
=
MethodCall
.
new
(
name
,
trans
action
)
end
method
...
...
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