Esempio n. 1
0
    def run(cls) -> Dict:
        timeout = conf.get(HEALTH_CHECK_WORKER_TIMEOUT)
        arg = random.randint(1, 10)
        result = None
        try:
            task_result = celery_app.send_task(
                cls.WORKER_HEALTH_TASK,
                args=[arg, arg],
                expires=timeout,
            )
            task_result.get(timeout=timeout)
            if task_result.result != health_task(arg, arg):
                result = Result(
                    message='Service returned wrong health result.',
                    severity=Result.WARNING
                )
        except IOError:
            result = Result(
                message='Service has an "IOError".',
                severity=Result.ERROR
            )
        except Exception as e:
            result = Result(
                message='Service has an "{}" error.'.format(e),
                severity=Result.ERROR
            )
        if not result:
            result = Result()

        return {cls.WORKER_NAME: result}
Esempio n. 2
0
def k8s_events_health(x: int, y: int) -> int:
    return health_task.health_task(x, y)
Esempio n. 3
0
def hp_health(x, y):
    return health_task.health_task(x, y)
Esempio n. 4
0
def logs_health(x: int, y: int) -> int:
    return health_task.health_task(x, y)
Esempio n. 5
0
def pipelines_health(x, y):
    return health_task.health_task(x, y)
Esempio n. 6
0
def scheduler_health(x, y):
    return health_task.health_task(x, y)
Esempio n. 7
0
def events_health(x, y):
    return health_task.health_task(x, y)
Esempio n. 8
0
def pipelines_health(x: int, y: int) -> int:
    return health_task.health_task(x, y)
Esempio n. 9
0
def crons_health(x, y):
    return health_task.health_task(x, y)
Esempio n. 10
0
def logs_health(x, y):
    return health_task.health_task(x, y)