-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(SLV-672) Add system class to manage system metric #30
Conversation
manifests/sar_metric.pp
Outdated
cron { "${metrics_type}_metrics_tidy" : | ||
ensure => $metric_ensure, | ||
user => 'root', | ||
hour => fqdn_rand(3, $metrics_type ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the 3 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the max for the hour. Basically will generate a random number between 0 and 3. This is so all the cron jobs don't run at the same time and possibly impact perf. It's just a copy pasta from pe_metric.pp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked offline about this, and added a comment.
manifests/sar_metric.pp
Outdated
ensure => $metric_ensure, | ||
user => 'root', | ||
hour => fqdn_rand(3, $metrics_type ), | ||
minute => (5 * fqdn_rand(11, $metrics_type )), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the 5 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another copy paste from pe_metric.pp generates a random number between 0 and 5 for the minute it should run to try an not run all metrics gathering at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
talked offline and added a comment
7ad2425
to
8235b24
Compare
manifests/sar_metric.pp
Outdated
define puppet_metrics_collector::sar_metric ( | ||
String $output_dir, | ||
String $scripts_dir, | ||
Enum['absent', 'present'] $metric_ensure = 'present', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems odd to have some of these aligned with extra spaces ($metric_ensure, $metrics_type, etc...) and the rest not aligned ($polling_frequency_seconds, $collection_frequency). Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They look aligned with extra space on my screen?
manifests/sar_metric.pp
Outdated
cron { "${metrics_type}_metrics_tidy" : | ||
ensure => $metric_ensure, | ||
user => 'root', | ||
hour => fqdn_rand(3, $metrics_type ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hour => fqdn_rand(3, $metrics_type ), | |
hour => fqdn_rand(3, $metrics_type), |
manifests/sar_metric.pp
Outdated
ensure => $metric_ensure, | ||
user => 'root', | ||
hour => fqdn_rand(3, $metrics_type ), | ||
minute => (5 * fqdn_rand(11, $metrics_type )), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minute => (5 * fqdn_rand(11, $metrics_type )), | |
minute => (5 * fqdn_rand(11, $metrics_type)), |
manifests/system_cpu.pp
Outdated
} | ||
|
||
puppet_metrics_collector::sar_metric { 'cpu' : | ||
metric_ensure => $metrics_ensure, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is being aligned with the code above:
metric_ensure => $metrics_ensure, | |
metric_ensure => $metrics_ensure, |
otherwise:
metric_ensure => $metrics_ensure, | |
metric_ensure => $metrics_ensure, |
manifests/system_memory.pp
Outdated
} | ||
|
||
puppet_metrics_collector::sar_metric { 'memory' : | ||
metric_ensure => $metrics_ensure, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See alignment suggestion in 'system_cpu ' above.
7dec69d
to
84932b8
Compare
@RandellP this PR requires a rebase before it can be merged. |
62fd050
43543af
to
02fad23
Compare
I am running some tests with this now and will report back this afternoon with the results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few small changes and this looks to be running well on my systems.
manifests/system.pp
Outdated
file { "${scripts_dir}/generate_system_metrics": | ||
ensure => present, | ||
mode => '0755', | ||
source => 'puppet:///modules/puppet_metrics_collector/generate_system_metrics' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generate_system_metrics
file declaration should be outside of the if ! defined
block since it is not declared anywhere else. This caused the generate_system_metrics
to be missing on my system when both of the classes below were included in my test system.
include puppet_metrics_collector
include puppet_metrics_collector::system
aee4d5c
to
fbb45f8
Compare
The new system class is very similar to the init.pp... this is to keep the two seperate during development. They may get merged in teh future. But the work flow is such that the master would have puppet metrics collector and sysystem included, while the compilers would only have system. To merge them would require a clean way to turn off all pe metrics for the compilers. Also added system_cpu and system_memory to use sar_metric to gather cpu and memory metrics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Depends on #28
The new system class is very similar to the init.pp... this is to keep the two seperate during development.
They may get merged in teh future. But the work flow is such that the master would have puppet metrics collector and sysystem included, while the compilers would only have system. To merge them would require a clean way to turn off all pe metrics for the compilers.
Also added system_cpu and system_memory to use sar_metric to gather cpu and memory metrics.