def validate_metric()

in integ/validate_cloudwatch/validator.py [0:0]


def validate_metric(test_name, metric_namespace, dim_key, dim_value, expected_samples=1):
    attempts = 0
    max_attempts = 20
    while attempts < max_attempts:
        if metric_exists(metric_namespace, dim_key, dim_value, expected_samples):
            print('SUCCESS: ' + test_name)
            return True
        attempts += 1
        print(f"No metrics yet. Sleeping before trying again. Attempt # {attempts}")
        time.sleep(10)

    sys.exit('TEST_FAILURE: failed to validate metric existence in CloudWatch')