<commit_before>#! /usr/bin/env nix-shell
#! nix-shell release-benchmarks.nix -i bash
#
# This script runs the lwAFTR release benchmarks
#
# Set SNABB_CPU0 to pick the CPU for the lwAFTR
# Set SNABB_PCI0 to SNABB_PCI7 when calling

if [ ! $SNABB_CPU0 ]; then
    echo ">> SNABB_CPU0 not set, defaulting to 0"
    SNABB_CPU0=0
fi

if [ ! $SNABB_PCI0 ] || [ ! $SNABB_PCI1 ]; then
    echo ">> At least SNABB_PCI0 and SNABB_PCI1 must be set"
    exit 1
fi

if [ ! $SNABB_PCI2 ] || [ ! $SNABB_PCI3 ]; then
    echo ">> SNABB_PCI2 or SNABB_PCI3 not set, only running on-a-stick tests"
    ON_A_STICK_ONLY=1
fi

if [ ! $SNABB_PCI4 ] || [ ! $SNABB_PCI5 ] || [ ! $SNABB_PCI6 ] || [ ! $SNABB_PCI7]; then
    echo ">> SNABB_PCI4 through SNABB_PCI7 need to be set for 2 instance, 2 NIC test"
    ONE_INSTANCE_ONLY=1
fi

# directory this script lives in
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
DIR=$(dirname "$(readlink -f "$0")")

# path to snabb executable
SNABB=$DIR/../../../../snabb

# config files & pcap dataset paths
FROM_B4_PCAP=$dataset/from-b4-test.pcap
FROM_INET_PCAP=$dataset/from-inet-test.pcap
FROM_INET_AND_B4_PCAP=$dataset/from-inet-and-b4-test.pcap
CONFIGS=$dataset/*.conf

# make sure lwaftr gets shut down even on interrupt<commit_msg>Fix typo in env var check in benchmarking script<commit_after>#! /usr/bin/env nix-shell
#! nix-shell release-benchmarks.nix -i bash
#
# This script runs the lwAFTR release benchmarks
#
# Set SNABB_CPU0 to pick the CPU for the lwAFTR
# Set SNABB_PCI0 to SNABB_PCI7 when calling

if [ ! $SNABB_CPU0 ]; then
    echo ">> SNABB_CPU0 not set, defaulting to 0"
    SNABB_CPU0=0
fi

if [ ! $SNABB_PCI0 ] || [ ! $SNABB_PCI1 ]; then
    echo ">> At least SNABB_PCI0 and SNABB_PCI1 must be set"
    exit 1
fi

if [ ! $SNABB_PCI2 ] || [ ! $SNABB_PCI3 ]; then
    echo ">> SNABB_PCI2 or SNABB_PCI3 not set, only running on-a-stick tests"
    ON_A_STICK_ONLY=1
fi

if [ ! $SNABB_PCI4 ] || [ ! $SNABB_PCI5 ] || [ ! $SNABB_PCI6 ] || [ ! $SNABB_PCI7 ]; then
    echo ">> SNABB_PCI4 through SNABB_PCI7 need to be set for 2 instance, 2 NIC test"
    ONE_INSTANCE_ONLY=1
fi

# directory this script lives in
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
DIR=$(dirname "$(readlink -f "$0")")

# path to snabb executable
SNABB=$DIR/../../../../snabb

# config files & pcap dataset paths
FROM_B4_PCAP=$dataset/from-b4-test.pcap
FROM_INET_PCAP=$dataset/from-inet-test.pcap
FROM_INET_AND_B4_PCAP=$dataset/from-inet-and-b4-test.pcap
CONFIGS=$dataset/*.conf

# make sure lwaftr gets shut down even on interrupt
{'fraction_non_alphanumeric': 0.12783661119515885, 'fraction_numerical': 0.02798789712556732, 'mean_word_length': 3.826642335766423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '2014874', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1054, 'n_words': 263}