CO - Insured data is logged in database specified by plan

community
Gogs 7 years ago
parent 46bdb4d197
commit 31ff495f74

@ -256,6 +256,9 @@ def InitCollector():
agent.init(args)
lagents.append(agent)
config = dict(CONFIG)
#
# @TODO: The database name should be provided by the active plan
#
config['store']['args']['dbname'] = 'monitor-logs'
config['store']['args']['uid'] = key
manager = Manager()

@ -41,8 +41,8 @@ class Manager() :
if len(meta) > 0 :
self.DELAY = 60* max([ int(item['delay']) for item in meta])
self.LIMIT = max([ int(item['limit']) for item in meta ])
dbname = [item['id'] for item in meta if meta['limit'] == self.LIMIT][0]
self.conf['store']['args']['dbname'] = dbname
dbname = [item['name'] for item in plans if int(item['metadata']['limit']) == self.LIMIT][0]
self.config['store']['args']['dbname'] = dbname
else:
self.DELAY = -1
@ -81,7 +81,6 @@ class Manager() :
else:
#label = id
row = data
self.lock.acquire()
store = self.factory.instance(type=write_class,args=read_args)
store.flush(size=self.LIMIT)

Loading…
Cancel
Save