示例#1
0
def main(runOnce):
    logConfig(True)
    config = {}
    config['feedThresholdPercent'] = 50.0
    config['fupThresholdPercent'] = 90.0
    config['configDir'] = '/opt/ems/fast'
    config['fastHome'] = DEFAULT_FAST_HOME
    controller = getController(config)
    controller.loadQueues()
    if len(feedLocs) > 0:
        log('DocAPIQueueSizeController: locations disabled for feed:' + str(feedLocs))
    if len(fupLocs) > 0:
        log('DocAPIQueueSizeController: locations disabled for fup:' + str(fupLocs))
    fcm = FastClusterManager(config['fastHome'])
    while True: 
        fsm = FastStatisticsManager('localhost',8080)
        controller = getController(config)
        controller.run(fcm,fsm,fsm.getStatistics())
        if runOnce:
            break
        else:
            time.sleep(300)