Ejemplo n.º 1
0
 def logDBCleanUp(self, config):
     """
     gather active data statistics
     """
     
     logdb = LogDB(config.central_logdb_url, config.log_reporter)
     logdb.cleanup(config.logDBCleanDuration)
     
     cherrypy.log("cleaned up log db")        
     return
Ejemplo n.º 2
0
    def logDBCleanUp(self, config):
        """
        gather active data statistics
        """

        logdb = LogDB(config.central_logdb_url, config.log_reporter)
        logdb.cleanup(config.logDBCleanDuration)

        self.logger.info("cleaned up log db")
        return
Ejemplo n.º 3
0
class LogDBTasks(CherryPyPeriodicTask):
    def __init__(self, rest, config):
        super(LogDBTasks, self).__init__(config)
        self.logdb = LogDB(config.central_logdb_url, config.log_reporter)

    def setConcurrentTasks(self, config):
        """
        Set logDBCleanUp method to be executed in a polling cycle
        """
        self.concurrentTasks = [{
            'func': self.logDBCleanUp,
            'duration': config.logDBCleanDuration
        }]

    def logDBCleanUp(self, config):
        """
        gather active data statistics
        """
        self.logger.info("Cleaning documents from LogDB WMStats")
        docs = self.logdb.cleanup(config.keepDocsAge)
        self.logger.info("Deleted %d old documents", len(docs))

        return