예제 #1
0
파일: api.py 프로젝트: uber-haupt/polyaxon
    def handle_experiment_disconnected_ws(ws):
        ws_manager.remove_sockets(ws)
        if len(ws_manager.ws) == 0:
            logger.info('Stopping resources monitor for uuid {}'.format(experiment_uuid))
            RedisToStream.remove_experiment_resources(experiment_uuid=experiment_uuid)
            request.app.experiment_resources_ws_mangers.pop(experiment_uuid, None)

        logger.info('Quitting resources socket for uuid {}'.format(experiment_uuid))
예제 #2
0
파일: api.py 프로젝트: qzl1221117/polyaxon
    def handle_experiment_disconnected_ws(ws):
        ws_manager.remove_sockets(ws)
        if not ws_manager.ws:
            _logger.info('Stopping resources monitor for uuid %s', experiment_uuid)
            RedisToStream.remove_experiment_resources(experiment_uuid=experiment_uuid)
            request.app.experiment_resources_ws_mangers.pop(experiment_uuid, None)

        _logger.info('Quitting resources socket for uuid %s', experiment_uuid)
예제 #3
0
 def test_monitor_experiment_resources(self):
     expeirment_uuid = uuid.uuid4().hex
     RedisToStream.monitor_experiment_resources(expeirment_uuid)
     assert RedisToStream.is_monitored_experiment_resources(
         expeirment_uuid) is True
     RedisToStream.remove_experiment_resources(expeirment_uuid)
     assert RedisToStream.is_monitored_experiment_resources(
         expeirment_uuid) is False
예제 #4
0
파일: api.py 프로젝트: ttsvetanov/polyaxon
    def handle_experiment_disconnected_ws(ws):
        ws_manager.remove_sockets(ws)
        if not ws_manager.ws:
            logger.info('Stopping resources monitor for uuid %s', experiment_uuid)
            RedisToStream.remove_experiment_resources(experiment_uuid=experiment_uuid)
            request.app.experiment_resources_ws_mangers.pop(experiment_uuid, None)

        logger.info('Quitting resources socket for uuid %s', experiment_uuid)
예제 #5
0
    def test_experiment_monitoring(self):
        experiment_uuid = uuid.uuid4().hex
        assert RedisToStream.is_monitored_experiment_resources(experiment_uuid) is False
        RedisToStream.monitor_experiment_resources(experiment_uuid)
        assert RedisToStream.is_monitored_experiment_resources(experiment_uuid) is True
        RedisToStream.remove_experiment_resources(experiment_uuid)
        assert RedisToStream.is_monitored_experiment_resources(experiment_uuid) is False

        assert RedisToStream.is_monitored_experiment_logs(experiment_uuid) is False
        RedisToStream.monitor_experiment_logs(experiment_uuid)
        assert RedisToStream.is_monitored_experiment_logs(experiment_uuid) is True
        RedisToStream.remove_experiment_logs(experiment_uuid)
        assert RedisToStream.is_monitored_experiment_logs(experiment_uuid) is False