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
62ef34cb
Commit
62ef34cb
authored
Jan 16, 2018
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put View instrumentation and transaction memory use behind feature
parent
66c1acba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
lib/gitlab/metrics/subscribers/action_view.rb
lib/gitlab/metrics/subscribers/action_view.rb
+6
-4
lib/gitlab/metrics/transaction.rb
lib/gitlab/metrics/transaction.rb
+3
-3
No files found.
lib/gitlab/metrics/subscribers/action_view.rb
View file @
62ef34cb
...
@@ -4,9 +4,11 @@ module Gitlab
...
@@ -4,9 +4,11 @@ module Gitlab
# Class for tracking the rendering timings of views.
# Class for tracking the rendering timings of views.
class
ActionView
<
ActiveSupport
::
Subscriber
class
ActionView
<
ActiveSupport
::
Subscriber
include
Gitlab
::
Metrics
::
Concern
include
Gitlab
::
Metrics
::
Concern
histogram
:gitlab_view_rendering_duration_seconds
,
'View rendering time'
,
define_histogram
:gitlab_view_rendering_duration_seconds
,
base_labels:
Transaction
::
BASE_LABELS
.
merge
({
path:
nil
}),
docstring:
'View rendering time'
,
buckets:
[
0.001
,
0.002
,
0.005
,
0.01
,
0.02
,
0.05
,
0.1
,
0.500
,
2.0
,
10.0
]
base_labels:
Transaction
::
BASE_LABELS
.
merge
({
path:
nil
}),
buckets:
[
0.001
,
0.01
,
0.1
,
10.0
],
with_feature: :prometheus_metrics_view_instrumentation
attach_to
:action_view
attach_to
:action_view
...
@@ -24,7 +26,7 @@ module Gitlab
...
@@ -24,7 +26,7 @@ module Gitlab
values
=
values_for
(
event
)
values
=
values_for
(
event
)
tags
=
tags_for
(
event
)
tags
=
tags_for
(
event
)
gitlab_view_rendering_duration_seconds
.
observe
(
current_transaction
.
labels
.
merge
(
tags
),
event
.
duration
)
self
.
class
.
gitlab_view_rendering_duration_seconds
.
observe
(
current_transaction
.
labels
.
merge
(
tags
),
event
.
duration
)
current_transaction
.
increment
(
:view_duration
,
event
.
duration
)
current_transaction
.
increment
(
:view_duration
,
event
.
duration
)
current_transaction
.
add_metric
(
SERIES
,
values
,
tags
)
current_transaction
.
add_metric
(
SERIES
,
values
,
tags
)
...
...
lib/gitlab/metrics/transaction.rb
View file @
62ef34cb
...
@@ -140,13 +140,13 @@ module Gitlab
...
@@ -140,13 +140,13 @@ module Gitlab
define_histogram
:gitlab_transaction_duration_seconds
,
define_histogram
:gitlab_transaction_duration_seconds
,
docstring:
'Transaction duration'
,
docstring:
'Transaction duration'
,
base_labels:
BASE_LABELS
,
base_labels:
BASE_LABELS
,
buckets:
[
0.001
,
0.01
,
0.1
,
0.5
,
10.0
],
buckets:
[
0.001
,
0.01
,
0.1
,
0.5
,
10.0
]
with_feature: :prometheus_metrics_method_instrumentation
define_histogram
:gitlab_transaction_allocated_memory_bytes
,
define_histogram
:gitlab_transaction_allocated_memory_bytes
,
docstring:
'Transaction allocated memory bytes'
,
docstring:
'Transaction allocated memory bytes'
,
base_labels:
BASE_LABELS
,
base_labels:
BASE_LABELS
,
buckets:
[
100
,
1000
,
10000
,
100000
,
1000000
,
10000000
]
buckets:
[
100
,
1000
,
10000
,
100000
,
1000000
,
10000000
],
with_feature: :prometheus_metrics_transaction_allocated_memory
def
self
.
transaction_metric
(
name
,
type
,
prefix:
nil
,
tags:
{})
def
self
.
transaction_metric
(
name
,
type
,
prefix:
nil
,
tags:
{})
metric_name
=
"gitlab_transaction_
#{
prefix
}#{
name
}
_total"
.
to_sym
metric_name
=
"gitlab_transaction_
#{
prefix
}#{
name
}
_total"
.
to_sym
...
...
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