fix(tooling): harden internode transport benchmark setup (#3037)

* refactor(config): centralize internode transport constants

* fix(bench): guard all ripgrep calls behind dry-run check

Move require_cmd rg and metrics collection inside the non-dry-run
path so that --dry-run works on hosts without rg installed.

* feat(tooling): cross-platform protoc setup for Linux and macOS

Make install-protoc.sh support Linux (x86_64, aarch64) alongside
macOS, and bump CI protoc from 29.3 to 33.1 to match the version
required by the gproto build script.

* fix(bench): record internode baseline error counts

* fix(skill): correct YAML frontmatter formatting for release-version-bump

* chore(ci): bump protoc version to 34.1

* fix(tooling): bump protoc 33.1 to 34.1 in install script, restore SKILL.md description

---------

Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
This commit is contained in:
Henry Guo
2026-05-21 13:47:32 +08:00
committed by GitHub
parent 503f89bf0e
commit 69dcf9e6cb
7 changed files with 85 additions and 29 deletions
+38 -12
View File
@@ -187,7 +187,7 @@ setup_output() {
fi
mkdir -p "$OUT_DIR"
SUMMARY_CSV="$OUT_DIR/summary.csv"
echo "size,tool,concurrency,status,throughput,requests_per_sec,avg_latency,log_file" > "$SUMMARY_CSV"
echo "size,tool,concurrency,status,throughput,requests_per_sec,avg_latency,error_count,log_file" > "$SUMMARY_CSV"
}
resolve_bucket() {
@@ -214,6 +214,27 @@ collect_metrics() {
echo "${throughput:-N/A},${reqps:-N/A},${latency:-N/A}"
}
collect_error_count() {
local log_file="$1"
local count
count="$(
{ rg -io '(errors?|failures?)[[:space:]:=]+[0-9]+' "$log_file" || true; } \
| awk '{ value = $0; gsub(/[^0-9]/, "", value); if (value != "") sum += value } END { if (NR > 0) print sum }'
)"
if [[ -n "$count" ]]; then
echo "$count"
return
fi
if [[ "$TOOL" == "warp" ]]; then
count="$(rg -c 'warp: <ERROR>' "$log_file" || true)"
else
count="$(rg -ci '(^|[[:space:]])(error|failed|failure)(:|[[:space:]])' "$log_file" || true)"
fi
echo "${count:-0}"
}
run_one() {
local size="$1"
local log_file="$OUT_DIR/${TOOL}_${size}.log"
@@ -279,29 +300,34 @@ run_one() {
fi
fi
if [[ "$TOOL" == "warp" ]]; then
local metrics throughput reqps latency error_count
if [[ "$DRY_RUN" != "true" ]]; then
metrics="$(collect_metrics "$log_file")"
throughput="$(echo "$metrics" | cut -d',' -f1)"
reqps="$(echo "$metrics" | cut -d',' -f2)"
latency="$(echo "$metrics" | cut -d',' -f3)"
error_count="$(collect_error_count "$log_file")"
# Warp may still exit with code 0 even when it prints runtime failures.
# Treat explicit error lines as failed runs to keep summary.csv reliable.
if rg -q 'warp: <ERROR>' "$log_file"; then
if [[ "$TOOL" == "warp" && "$error_count" != "0" ]]; then
status="failed"
fi
else
throughput="N/A"
reqps="N/A"
latency="N/A"
error_count="N/A"
fi
local metrics throughput reqps latency
metrics="$(collect_metrics "$log_file")"
throughput="$(echo "$metrics" | cut -d',' -f1)"
reqps="$(echo "$metrics" | cut -d',' -f2)"
latency="$(echo "$metrics" | cut -d',' -f3)"
echo "$size,$TOOL,$CONCURRENCY,$status,$throughput,$reqps,$latency,$log_file" >> "$SUMMARY_CSV"
echo "$size,$TOOL,$CONCURRENCY,$status,$throughput,$reqps,$latency,$error_count,$log_file" >> "$SUMMARY_CSV"
}
main() {
parse_args "$@"
validate_args
resolve_bucket
require_cmd rg
if [[ "$DRY_RUN" != "true" ]]; then
require_cmd rg
require_cmd awk
if [[ "$TOOL" == "warp" ]]; then
require_cmd "$WARP_BIN"
else