Reduce the collectd samples retention period
Collectd creates a samples database within the InfluxDB database which is stored in the rootfs. The current 4 week retention period is too long for larger systems and could lead to the rootfs filling up. This update reduces that retention perid to 1 week to protect the rootfs from being filled up with sample data until the samples database is moved to a more appropriate location. Change-Id: Ic59712849fa228f19d15919594d23edc43109a0b Closes-Bug: 1827301 Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
parent
dcbe61a3f0
commit
904da6755d
@ -22,4 +22,4 @@ COPY_LIST="$PKG_BASE/src/LICENSE \
|
||||
$PKG_BASE/src/ptp.conf \
|
||||
$PKG_BASE/src/example.py \
|
||||
$PKG_BASE/src/example.conf"
|
||||
TIS_PATCH_VER=10
|
||||
TIS_PATCH_VER=11
|
||||
|
@ -283,7 +283,7 @@ class PluginObject:
|
||||
collectd.info('%s %s : %s' % (PLUGIN, self.plugin, string))
|
||||
|
||||
def _llog(self, string):
|
||||
"""Create a collectd notifier info log with the string param if debug_lists"""
|
||||
"""Create a collectd notifier info log when debug_lists not empty"""
|
||||
if debug_lists:
|
||||
collectd.info('%s %s : %s' % (PLUGIN, self.plugin, string))
|
||||
|
||||
@ -1077,7 +1077,7 @@ def _database_setup(database):
|
||||
# TODO: Read current retention period from service parameter
|
||||
# Make it a puppet implementation.
|
||||
#
|
||||
# Create a 1 month samples retention policy
|
||||
# Create a '1 week' samples retention policy
|
||||
# -----------------------------------------
|
||||
# name = 'collectd samples'
|
||||
# duration = set retention period in time
|
||||
@ -1092,14 +1092,14 @@ def _database_setup(database):
|
||||
############################################################
|
||||
|
||||
PluginObject.dbObj.create_retention_policy(
|
||||
DATABASE_NAME, '4w', 1, database, True)
|
||||
DATABASE_NAME, '1w', 1, database, True)
|
||||
except Exception as ex:
|
||||
if str(ex) == 'database already exists':
|
||||
try:
|
||||
collectd.info("%s influxdb:collectd %s" %
|
||||
(PLUGIN, str(ex)))
|
||||
PluginObject.dbObj.create_retention_policy(
|
||||
DATABASE_NAME, '4w', 1, database, True)
|
||||
DATABASE_NAME, '1w', 1, database, True)
|
||||
except Exception as ex:
|
||||
if str(ex) == 'retention policy already exists':
|
||||
collectd.info("%s influxdb:collectd %s" %
|
||||
|
Loading…
Reference in New Issue
Block a user