<commit_before>#!/bin/bash

function usage {
    echo "$0 [ -n NUM_CLIENTS ] [ -p PER_CLIENT_FLOWS ]"
}

N=100
P=1

# Option parsing
while [[ $# > 0 ]]
do
    key="$1"
    case $key in
        "-n")
        if [ -n "$2" ]; then
            N="$2"
            shift
        else
            echo "-n requires a numeric argument"
            exit 255
        fi
        ;;

        "-p")
        if [ -n "$2" ]; then
            P="$2"
            shift
        else
            echo "-p requires a numeric argument"
            exit 255
        fi
        ;;

        "-h")
            usage
            exit 0
        ;;

        *)
        echo "Unknown option '$key'"
        exit 255
        ;;
    esac
    shift
done

# Run multiple client instances
for i in $(seq 1 $N); do
    rinaperf -z rinaperf-server:$i -p $P -t perf -c 1000 -i 10000 &
done<commit_msg>tests: parallel-clients.sh: add -c and -t options<commit_after>#!/bin/bash

function usage {
    echo "$0 [-n NUM_CLIENTS] [-p PER_CLIENT_FLOWS] [-c PER_FLOW_PACKETS] [-t TEST_TYPE]"
}

N=100
P=1
C=1000
T=perf

# Option parsing
while [[ $# > 0 ]]
do
    key="$1"
    case $key in
        "-n")
        if [ -n "$2" ]; then
            N="$2"
            shift
        else
            echo "-n requires a numeric argument"
            exit 255
        fi
        ;;

        "-p")
        if [ -n "$2" ]; then
            P="$2"
            shift
        else
            echo "-p requires a numeric argument"
            exit 255
        fi
        ;;

        "-c")
        if [ -n "$2" ]; then
            C="$2"
            shift
        else
            echo "-c requires a numeric argument"
            exit 255
        fi
        ;;

        "-t")
        if [ -n "$2" ]; then
            T="$2"
            shift
        else
            echo "-t requires a test type (perf, ping, rr)"
            exit 255
        fi
        ;;

        "-h")
            usage
            exit 0
        ;;

        *)
        echo "Unknown option '$key'"
        exit 255
        ;;
    esac
    shift
done

# Run multiple client instances
for i in $(seq 1 $N); do
    rinaperf -z rinaperf-server:$i -p $P -t $T -c $C -i 10000 &
done
{'fraction_non_alphanumeric': 0.1223185759926974, 'fraction_numerical': 0.032861706983112735, 'mean_word_length': 1.0757575757575757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5687237', 'n_tokens_mistral': 769, 'n_tokens_neox': 678, 'n_words': 228}