Showing with 31 additions and 3 deletions.
  1. +8 −0 CHANGELOG.md
  2. +1 −1 manifests/system/postgres.pp
  3. +1 −1 manifests/system/vmware.pp
  4. +1 −1 metadata.json
  5. +8 −0 spec/classes/init_spec.rb
  6. +12 −0 spec/classes/puppet_metrics_collector_system_spec.rb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v7.0.5](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/tree/v7.0.5) (2021-10-12)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/compare/v7.0.4...v7.0.5)

### Fixed

- \(SUP-2725\) Fix system collection frequency [\#150](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/pull/150) ([m0dular](https://github.com/m0dular))

## [v7.0.4](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/tree/v7.0.4) (2021-09-30)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/compare/v7.0.3...v7.0.4)
Expand Down
2 changes: 1 addition & 1 deletion manifests/system/postgres.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
metrics_command => $metrics_command,
tidy_command => $tidy_command,
metric_ensure => $metrics_ensure,
minute => String($collection_frequency),
minute => "0/${collection_frequency}",
notify => Exec['puppet_metrics_collector_system_daemon_reload'],
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/system/vmware.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
metrics_command => $metrics_command,
tidy_command => $tidy_command,
metric_ensure => $metrics_ensure,
minute => String($collection_frequency),
minute => "0/${collection_frequency}",
notify => Exec['puppet_metrics_collector_system_daemon_reload'],
}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-puppet_metrics_collector",
"version": "7.0.4",
"version": "7.0.5",
"author": "puppetlabs",
"summary": "A Puppet module for gathering metrics from PE components",
"license": "Apache-2.0",
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@

it { is_expected.to compile }
end

context 'when customizing the collection frequency' do
let(:params) { { collection_frequency: 10 } }

['ace', 'bolt', 'orchestrator', 'puppetdb', 'puppetserver'].each do |service|
it { is_expected.to contain_file("/etc/systemd/system/puppet_#{service}-metrics.timer").with_content(%r{OnCalendar=.*0\/10}) }
end
end
end
12 changes: 12 additions & 0 deletions spec/classes/puppet_metrics_collector_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,16 @@ class {'puppet_metrics_collector':

it { is_expected.not_to contain_puppet_metrics_collector__collect('system_cpu').with_metrics_command(%r{--influx-db\s+puppet_metrics}) }
end

context 'when customizing the collection frequency' do
let(:facts) do
{ puppet_metrics_collector: { have_vmware_tools: true, have_systemd: true, have_sysstat: true, have_pe_psql: true },
virtual: 'vmware' }
end
let(:params) { { collection_frequency: 10 } }

['system_cpu', 'system_memory', 'system_processes', 'postgres', 'vmware'].each do |service|
it { is_expected.to contain_file("/etc/systemd/system/puppet_#{service}-metrics.timer").with_content(%r{OnCalendar=.*0\/10}) }
end
end
end