Skip to content

Commit

Permalink
Merge pull request #859 from cernops/ai5273
Browse files Browse the repository at this point in the history
Persist the interval in the conf file as a number
  • Loading branch information
traylenator committed Oct 10, 2018
2 parents 7fd54bc + f9b83ce commit 3fbab1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion spec/classes/collectd_plugin_postgresql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
'user' => 'postgres',
'password' => 'postgres',
'sslmode' => 'disable',
'query' => %w[disk_io log_delay]
'query' => %w[disk_io log_delay],
'interval' => 60
}
},
queries: {
Expand All @@ -61,6 +62,7 @@
it "Will create #{options[:plugin_conf_dir]}/postgresql-config.conf" do
is_expected.to contain_concat__fragment('collectd_plugin_postgresql_conf_db_postgres').with(content: %r{Host \"localhost\"})
is_expected.to contain_concat__fragment('collectd_plugin_postgresql_conf_db_postgres').with(content: %r{Query \"disk_io\"})
is_expected.to contain_concat__fragment('collectd_plugin_postgresql_conf_db_postgres').with(content: %r{Interval 60})
is_expected.to contain_concat__fragment('collectd_plugin_postgresql_conf_query_log_delay').with(content: %r{Statement \"SELECT \* FROM log_delay_repli;\"\n})
is_expected.to contain_concat__fragment('collectd_plugin_postgresql_conf_query_log_delay').with(content: %r{<Result>\n})
is_expected.to contain_concat__fragment('collectd_plugin_postgresql_conf_query_log_delay').with(content: %r{Param \"database\"})
Expand Down
2 changes: 1 addition & 1 deletion templates/plugin/postgresql/database.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Password "<%= @password %>"
<% end -%>
<% if @interval -%>
Interval "<%= @interval %>"
Interval <%= @interval %>
<% end -%>
<% if @instance -%>
Instance "<%= @instance %>"
Expand Down

0 comments on commit 3fbab1e

Please sign in to comment.