(check, env, rate, times, pause, delay, log_level, as_json, as_table, break_point, config_file, jmx_list)
Run an Agent check.
Run an Agent check.
Run an Agent check .
def check_run(check, env, rate, times, pause, delay, log_level, as_json, as_table, break_point, config_file, jmx_list):
    """Run an Agent check."""
    envs = get_configured_envs(check)
    if not envs:
        echo_failure(f'No active environments found for `{check}`.')
        echo_info(f'See what is available to start via `ddev env ls {check}`.')
        abort()

    if not env:
        if len(envs) > 1:
            echo_failure(f'Multiple active environments found for `{check}`, please specify one.')
            echo_info('See what is active via `ddev env ls`.')
            abort()

        env = envs[0]

    if env not in envs:
        echo_failure(f'`{env}` is not an active environment.')
        echo_info('See what is active via `ddev env ls`.')
        abort()

    environment = create_interface(check, env)
    check_args = dict(
        rate=rate,
        times=times,
        pause=pause,
        delay=delay,
        log_level=log_level,
        as_json=as_json,
        as_table=as_table,
        break_point=break_point,
        jmx_list=jmx_list,
    )

    if config_file:
        config = json.loads(read_file(config_file))
        with environment.use_config(config):
            environment.run_check(**check_args)
    else:
        environment.run_check(**check_args)

        if not rate and not as_json:
            echo_success('Note: ', nl=False)
            echo_info(
                'If some metrics are missing, you may want to try again with the -r / --rate flag '
                'for a classic integration.'
            )
def check_run ( check , env , rate , times , pause , delay , log_level , as_json , as_table , break_point , config_file , jmx_list ) : envs = get_configured_envs ( check ) if not envs : echo_failure ( f'No active environments found for `{check}`.' ) echo_info ( f'See what is available to start via `ddev env ls {check}`.' ) abort ( ) if not env : if len ( envs ) > 1 : echo_failure ( f'Multiple active environments found for `{check}`, please specify one.' ) echo_info ( 'See what is active via `ddev env ls`.' ) abort ( ) env = envs [ 0 ] if env not in envs : echo_failure ( f'`{env}` is not an active environment.' ) echo_info ( 'See what is active via `ddev env ls`.' ) abort ( ) environment = create_interface ( check , env ) check_args = dict ( rate = rate , times = times , pause = pause , delay = delay , log_level = log_level , as_json = as_json , as_table = as_table , break_point = break_point , jmx_list = jmx_list , ) if config_file : config = json . loads ( read_file ( config_file ) ) with environment . use_config ( config ) : environment . run_check ( * * check_args ) else : environment . run_check ( * * check_args ) if not rate and not as_json : echo_success ( 'Note: ' , nl = False ) echo_info ( 'If some metrics are missing, you may want to try again with the -r / --rate flag ' 'for a classic integration.' )