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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
23671600
Commit
23671600
authored
Jan 13, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the metrics sampler interval configurable
parent
83ad5fa5
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
272 additions
and
255 deletions
+272
-255
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+1
-0
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+7
-0
db/migrate/20160113111034_add_metrics_sample_interval.rb
db/migrate/20160113111034_add_metrics_sample_interval.rb
+6
-0
db/schema.rb
db/schema.rb
+255
-253
lib/gitlab/metrics.rb
lib/gitlab/metrics.rb
+2
-1
lib/gitlab/metrics/sampler.rb
lib/gitlab/metrics/sampler.rb
+1
-1
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
23671600
...
@@ -73,6 +73,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
...
@@ -73,6 +73,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:metrics_pool_size
,
:metrics_pool_size
,
:metrics_timeout
,
:metrics_timeout
,
:metrics_method_call_threshold
,
:metrics_method_call_threshold
,
:metrics_sample_interval
,
:recaptcha_enabled
,
:recaptcha_enabled
,
:recaptcha_site_key
,
:recaptcha_site_key
,
:recaptcha_private_key
,
:recaptcha_private_key
,
...
...
app/views/admin/application_settings/_form.html.haml
View file @
23671600
...
@@ -202,6 +202,13 @@
...
@@ -202,6 +202,13 @@
.help-block
.help-block
A method call is only tracked when it takes longer to complete than
A method call is only tracked when it takes longer to complete than
the given amount of milliseconds.
the given amount of milliseconds.
.form-group
=
f
.
label
:metrics_sample_interval
,
'Sampler Interval (sec)'
,
class:
'control-label col-sm-2'
.col-sm-10
=
f
.
number_field
:metrics_sample_interval
,
class:
'form-control'
.help-block
The sampling interval in seconds. Sampled data includes memory usage,
retained Ruby objects, file descriptors and so on.
%fieldset
%fieldset
%legend
Spam and Anti-bot Protection
%legend
Spam and Anti-bot Protection
...
...
db/migrate/20160113111034_add_metrics_sample_interval.rb
0 → 100644
View file @
23671600
class
AddMetricsSampleInterval
<
ActiveRecord
::
Migration
def
change
add_column
:application_settings
,
:metrics_sample_interval
,
:integer
,
default:
15
end
end
db/schema.rb
View file @
23671600
This diff is collapsed.
Click to expand it.
lib/gitlab/metrics.rb
View file @
23671600
...
@@ -13,7 +13,8 @@ module Gitlab
...
@@ -13,7 +13,8 @@ module Gitlab
timeout:
current_application_settings
[
:metrics_timeout
],
timeout:
current_application_settings
[
:metrics_timeout
],
method_call_threshold:
current_application_settings
[
:metrics_method_call_threshold
],
method_call_threshold:
current_application_settings
[
:metrics_method_call_threshold
],
host:
current_application_settings
[
:metrics_host
],
host:
current_application_settings
[
:metrics_host
],
port:
current_application_settings
[
:metrics_port
]
port:
current_application_settings
[
:metrics_port
],
sample_interval:
current_application_settings
[
:metrics_sample_interval
]
||
15
}
}
end
end
...
...
lib/gitlab/metrics/sampler.rb
View file @
23671600
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
# statistics, etc.
# statistics, etc.
class
Sampler
class
Sampler
# interval - The sampling interval in seconds.
# interval - The sampling interval in seconds.
def
initialize
(
interval
=
15
)
def
initialize
(
interval
=
Metrics
.
settings
[
:sample_interval
]
)
@interval
=
interval
@interval
=
interval
@metrics
=
[]
@metrics
=
[]
...
...
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