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

IAT_RUN_ID="$1"
TMP_DIR="$(mktemp -d -t bw-XXXXXXXXXX)"

bazel run //experimental/jake:print_topic_bw_over_runs -- \
    --output-path="$TMP_DIR"

bazel run //scripts/tools/zci:compare_bw_analysis -- \
        --lhs_run_id "$IAT_RUN_ID" \
        --avg_acceptable_kbps_increase=150 \
        --bw_type=bw_vehicle_diff \
        --rhs_pbtxt "$TMP_DIR/golden_bw_analysis.pbtxt" \
        --ingest \
        --no_bazel

rm -r $TMP_DIR
