def __init__(self, results, input): stop_event = threading.Event() message_types = [Message.TEST] + ResultMessages command = f"grep -E '^({'|'.join([str(int(i)) for i in message_types])}),'" steps = [ read_and_filter_transform(input, command=command), parse_transform(stop_event), results_transform(results, stop_event), ] super(Handler.FirstStage, self).__init__(steps)
def __init__(self, name, input, output, tail=False): stop_event = threading.Event() command = f"grep -E '^1,.*,\"{name}[^/]*\",' -m 1" steps = [ read_and_filter_transform(input, command=command, tail=tail), parse_transform(stop_event), short_transform(), write_transform(output), ] super(Handler.Pipeline, self).__init__(steps)
def __init__(self, name, input, output, tail=False): stop_event = threading.Event() command = "grep -E '^{\"message_keyword\":\"%s\"" % Message.TEST.name command += ".+,\"test_name\":\"%s.*?\",'" % name.replace( "'", r"'\''") steps = [ read_and_filter_transform(input, command=command, tail=tail), parse_transform(stop_event), procedure_transform(), write_transform(output), ] super(Handler.Pipeline, self).__init__(steps)
def __init__(self, name, input, output, format=None, tail=False): stop_event = threading.Event() command = f"grep -E \',\"test_id\":\"%s'" % name steps = [ read_and_filter_transform(input, command=command, tail=tail) ] if format == "nice": steps += [parse_transform(stop_event), nice_transform()] elif format == "short": steps += [parse_transform(stop_event), short_transform()] elif format == "slick": steps += [parse_transform(stop_event), slick_transform()] steps.append(write_transform(output)) super(Handler.Pipeline, self).__init__(steps)
def __init__(self, name, input, output, tail=False): stop_event = threading.Event() message_types = [ Message.TEST.name ] command = "grep -E '^{\"message_keyword\":\"" command = f"{command}({'|'.join(message_types)})\"" command += ".+,\"test_name\":\"%s.*?\",'" % name.replace("'", r"'\''") steps = [ read_and_filter_transform(input, command=command, stop=stop_event, tail=tail), parse_transform(), sort_transform(stop_event), flat_transform(), write_transform(output), ] super(Handler.Pipeline, self).__init__(steps, restart_on_none=False)