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
Jérome Perrin
gitlab-ce
Commits
99881bb7
Commit
99881bb7
authored
Oct 16, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move labels to be initialized in constructor
parent
77e938a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
lib/gitlab/metrics/method_call.rb
lib/gitlab/metrics/method_call.rb
+2
-5
No files found.
lib/gitlab/metrics/method_call.rb
View file @
99881bb7
...
...
@@ -3,7 +3,7 @@ module Gitlab
# Class for tracking timing information about method calls
class
MethodCall
BASE_LABELS
=
{
module:
nil
,
method:
nil
}.
freeze
attr_reader
:real_time
,
:cpu_time
,
:call_count
attr_reader
:real_time
,
:cpu_time
,
:call_count
,
:labels
def
self
.
call_real_duration_histogram
@call_real_duration_histogram
||=
Gitlab
::
Metrics
.
histogram
(
...
...
@@ -31,6 +31,7 @@ module Gitlab
@method_name
=
method_name
@transaction
=
transaction
@name
=
name
@labels
=
{
module:
@module_name
,
method:
@method_name
}
@real_time
=
0
@cpu_time
=
0
@call_count
=
0
...
...
@@ -55,10 +56,6 @@ module Gitlab
retval
end
def
labels
@labels
||=
{
module:
@module_name
,
method:
@method_name
}
end
# Returns a Metric instance of the current method call.
def
to_metric
Metric
.
new
(
...
...
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