Introducing ttl to openstack-telemetry

ttl is the time_to_live value that will be configured against database. This value
indicates the expiry time for ceilometer samples

Implements: bluerprint ceilometer-db-cleanup-configuration

Change-Id: I1c207e15ec0ca23c2fbd0db10842e600e71d69df
This commit is contained in:
root 2015-03-24 11:09:25 -04:00 committed by Sudheesh
parent 8573eb1e1d
commit 5feb714c32
4 changed files with 12 additions and 0 deletions

View File

@ -76,6 +76,7 @@ Attributes
* `openstack['telemetry']['service-credentials']['cafile']` - A PEM encoded Certificate Authority to use when verifying HTTPs connections (for service polling authentication)
* `openstack['telemetry']['service-credentials']['insecure']` - Set whether to verify HTTPS connections (for service polling authentication)
* `openstack['telemetry']['dbsync_timeout']` - Set dbsync command timeout value
* `openstack['telemetry']['database']['time_to_live']` - Set a time_to_live parameter (ttl) for samples. Set -1 for no expiry
The following attributes are defined in attributes/default.rb of the common cookbook, but are documented here due to their relevance:

View File

@ -143,3 +143,6 @@ when 'debian'
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
}
end
# The time to live value for samples which is specified in seconds, override to -1 if no data expiry is required
default['openstack']['telemetry']['database']['time_to_live'] = 1800

View File

@ -175,6 +175,13 @@ describe 'openstack-telemetry::common' do
end
end
context 'database' do
it 'has time_to_live set' do
expect(chef_run).to render_config_file(file.name)\
.with_section_content('database', /^time_to_live=1800$/)
end
end
context 'service_credentials attributes with default values' do
it 'sets cafile' do
expect(chef_run).not_to render_file(file.name).with_content(/^os_cacert = $/)

View File

@ -61,6 +61,7 @@ periodic_interval = <%= node["openstack"]["telemetry"]["periodic_interval"] %>
[database]
connection=<%= @database_connection %>
time_to_live=<%= node["openstack"]["telemetry"]["database"]["time_to_live"] %>
[api]
host = <%= @api_bind_host %>