#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

export INPUT_MODEL="${INPUT_MODEL:-tcp}"
export TRANSPORT="${TRANSPORT:-cached}"
export IMPLEMENTATION="${IMPLEMENTATION:-handoff}"
export SCENARIO="${SCENARIO:-fragmented}"
export COMPLETION="${COMPLETION:-fire_and_forget}"
export INPUT_FRAGMENT="${INPUT_FRAGMENT:-64}"
export TCP_MSS_BYTES="${TCP_MSS_BYTES:-1460}"
export READ_RESERVE="${READ_RESERVE:-16384}"
export TUNNEL_BYTES="${TUNNEL_BYTES:-1048576}"
export WRITE_PENDING_BYTES="${WRITE_PENDING_BYTES:-524288}"
export COALESCER_STATS="${COALESCER_STATS:-1}"
export MIN_THRESHOLD_BYTES="${MIN_THRESHOLD_BYTES:-1}"
export MAX_THRESHOLD_BYTES="${MAX_THRESHOLD_BYTES:-262144}"
export MIN_THRESHOLD_POINTS="${MIN_THRESHOLD_POINTS:-11}"
export MAX_THRESHOLD_POINTS="${MAX_THRESHOLD_POINTS:-15}"
export BATCH_SIZE="${BATCH_SIZE:-3}"
export MAX_READS_PER_FLUSH="${MAX_READS_PER_FLUSH:-none}"

exec "$SCRIPT_DIR/run-coalescing-tuner.sh"
