def monitorPhase(runTime, workloadIds, rebalancing=False, queryIds=None): # monitor rebalance # monitor pre/post conditions lala running = True end_time = time.time() + int(runTime) while running: if time.time() > end_time: if rebalancing: monitorRebalance() rebalancing = False elif workloadIds is not None: for workloadId in workloadIds: running = getWorkloadStatus(workloadId) if running == True: # there is still a workload active continue else: running = False else: time.sleep(2) if queryIds != None: # stop queries for qid in queryIds: QueryWorkload.from_cache(qid).active = False
def monitorPhase(runTime, workloadIds, rebalancing = False, queryIds = None): # monitor rebalance # monitor pre/post conditions lala running = True end_time = time.time() + int(runTime) while running: if time.time() > end_time: if rebalancing: monitorRebalance() rebalancing = False elif workloadIds is not None: for workloadId in workloadIds: running = getWorkloadStatus(workloadId) if running == True: # there is still a workload active continue else: running = False else: time.sleep(2) if queryIds != None: # stop queries for qid in queryIds: QueryWorkload.from_cache(qid).active = False
def monitorPhase(runTime, workloadIds, rebalancing = False, queryIds = None): # monitor rebalance # monitor pre/post conditions lala running = True phase_status = True end_time = time.time() + int(runTime) while running: if time.time() > end_time: if rebalancing: phase_status = monitorRebalance() rebalancing = False elif workloadIds is not None and len(workloadIds) > 0: for workloadId in workloadIds: _status = getWorkloadStatus(workloadId) if _status == False: # remove stopped workload from list to stop polling index = workloadIds.index(workloadId) workloadIds.pop(index) else: running = False time.sleep(2) if queryIds != None: # stop queries for qid in queryIds: QueryWorkload.from_cache(qid).active = False return phase_status
def monitorPhase(runTime, workloadIds, rebalancing=False, queryIds=None): # monitor rebalance # monitor pre/post conditions lala running = True phase_status = True end_time = time.time() + int(runTime) while running: if time.time() > end_time: if rebalancing: phase_status = monitorRebalance() rebalancing = False elif workloadIds is not None and len(workloadIds) > 0: for workloadId in workloadIds: _status = getWorkloadStatus(workloadId) if _status == False: # remove stopped workload from list to stop polling index = workloadIds.index(workloadId) workloadIds.pop(index) else: running = False time.sleep(2) if queryIds != None: # stop queries for qid in queryIds: QueryWorkload.from_cache(qid).active = False return phase_status