Skip to content
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

Change server_puppetserver_profiler and server_puppetserver_metrics defaults to true #825

Merged
merged 2 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,11 @@
# Defaults to 30000, using the Jetty default of 30s
#
# $server_puppetserver_metrics:: Enable puppetserver http-client metrics
# Defaults to false because that's the Puppet Inc. default behaviour.
# Defaults to true, matching defaults in Puppetserver 5+.
#
# $server_puppetserver_profiler:: Enable JRuby profiling.
# Defaults to false because that's the Puppet Inc. default behaviour.
# Defaults to true, matching defaults in Puppetserver 5+.
# If set to false, compiler and function metrics will not be available, (eg. when enabling graphite metrics)
#
# $server_metrics_jmx_enable:: Enable or disable JMX metrics reporter. Defaults to true
#
Expand Down Expand Up @@ -707,8 +708,8 @@
Boolean $server_environment_class_cache_enabled = $puppet::params::server_environment_class_cache_enabled,
Boolean $server_allow_header_cert_info = $puppet::params::server_allow_header_cert_info,
Integer[0] $server_web_idle_timeout = $puppet::params::server_web_idle_timeout,
Boolean $server_puppetserver_metrics = false,
Boolean $server_puppetserver_profiler = false,
Boolean $server_puppetserver_metrics = true,
Boolean $server_puppetserver_profiler = true,
Boolean $server_metrics_jmx_enable = $puppet::params::server_metrics_jmx_enable,
Boolean $server_metrics_graphite_enable = $puppet::params::server_metrics_graphite_enable,
String $server_metrics_graphite_host = $puppet::params::server_metrics_graphite_host,
Expand Down
12 changes: 10 additions & 2 deletions spec/classes/puppet_server_puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
it {
should contain_file(puppetserver_conf)
.with_content(/^ # Whether to enable http-client metrics; defaults to 'true'.\n metrics-enabled: true$(.*)/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: true/)
}
it {
should contain_file('/etc/custom/puppetserver/conf.d/metrics.conf')
Expand All @@ -292,10 +292,18 @@
it {
should contain_file(puppetserver_conf)
.with_content(/^ # Whether to enable http-client metrics; defaults to 'true'.\n metrics-enabled: false$/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: true/)
}
it { should contain_file('/etc/custom/puppetserver/conf.d/metrics.conf').with_ensure('file') }
end

context 'when server_profiler => false' do
let(:params) { super().merge(server_puppetserver_profiler: false) }
it {
should contain_file(puppetserver_conf)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/)
}
end
end

describe 'server_experimental' do
Expand Down