Set reasonable TTL defaults for Ceilometer DB
authorPradeep Kilambi <pkilambi@redhat.com>
Wed, 3 May 2017 16:07:09 +0000 (12:07 -0400)
committerPradeep Kilambi <pkilambi@redhat.com>
Wed, 3 May 2017 16:07:09 +0000 (12:07 -0400)
By deafult, we let the data live for ever. Which isnt very efficient.
Lets expose params to tweak this and use a reasonable default.

Change-Id: I145fa73a7af9cb4135ba910d3659853b3baa893d

puppet/services/ceilometer-collector.yaml

index dfc844b..111b3e8 100644 (file)
@@ -51,7 +51,16 @@ parameters:
     type: comma_delimited_list
     constraints:
     - allowed_values: ['panko', 'gnocchi', 'database']
-
+  CeilometerEventTTL:
+    default: '86400'
+    description: Number of seconds that events are kept in the database for
+                 (<= 0 means forever)
+    type: string
+  CeilometerMeteringTTL:
+    default: '86400'
+    description: Number of seconds that samples are kept in the database for
+                 (<= 0 means forever)
+    type: string
 resources:
   CeilometerServiceBase:
     type: ./ceilometer-base.yaml
@@ -91,6 +100,8 @@ outputs:
                   - '/ceilometer'
                   - '?read_default_file=/etc/my.cnf.d/tripleo.cnf&read_default_group=tripleo'
             ceilometer_backend: {get_param: CeilometerBackend}
+            ceilometer::event_time_to_live: {get_param: CeilometerEventTTL}
+            ceilometer::metering_time_to_live: {get_param: CeilometerMeteringTTL}
             # we include db_sync class in puppet-tripleo
             ceilometer::db::sync_db: false
             ceilometer::db::database_db_max_retries: -1