From a2a45ea9d8ccc499ea94a5a9b0f3ec46ca83db86 Mon Sep 17 00:00:00 2001 From: reachableceo Date: Thu, 3 Sep 2026 16:55:28 -0500 Subject: [PATCH] =?UTF-8?q?feat(bench):=20harness=20v1.1=20=E2=80=94=20PSI?= =?UTF-8?q?=20latency,=20load,=20device=20identity=20context=20[#709]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces unavailable latencytop; sysstat/iotop deployed fleet-wide separately. Redmine: https://projects.knownelement.com/issues/709 --- proxmox/perf/bench/bench-run.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/proxmox/perf/bench/bench-run.sh b/proxmox/perf/bench/bench-run.sh index b00b7e3..6cda99d 100644 --- a/proxmox/perf/bench/bench-run.sh +++ b/proxmox/perf/bench/bench-run.sh @@ -30,6 +30,20 @@ b meta path "$BENCH_DIR" b meta runtime "$RUNTIME" b meta size "$SIZE" +# context: load, PSI latency (pressure stall info — the latencytop +# replacement on modern kernels), and the backing device of BENCH_DIR +b meta load "$(cat /proc/loadavg)" +if [ -d /proc/pressure ]; then + for rsc in io cpu memory; do + [ -r "/proc/pressure/$rsc" ] && \ + b "psi_${rsc}_some_avg10" "$(awk '{for(i=1;i<=NF;i++) if($i ~ /^avg10=/) sub("avg10=","",$i)} /^some/ {print $2; exit}' "/proc/pressure/$rsc" 2>/dev/null)" + done +fi +DEV=$(df -P "$BENCH_DIR" | awk 'NR==2 {print $1}') +b meta bench_device "$DEV" +[ -r "/sys/block/$(basename "$DEV")/queue/rotational" ] && \ + b meta bench_device_rotational "$(cat "/sys/block/$(basename "$DEV")/queue/rotational")" + # fio may print human notes (e.g. sync-engine warnings) before the JSON on # stdout; strip everything before the opening brace so jq always gets JSON. parse_fio() { # $1=json-file $2=testname $3=read|write @@ -58,6 +72,11 @@ run_fio seqwrite1m write --filename="$BENCH_DIR/perf-test-file" --rw=write - rm -f "$BENCH_DIR/.fio-out.json" "$BENCH_DIR/.fio-err" +# post-run pressure + load (did the bench itself saturate the box?) +b meta load_end "$(cat /proc/loadavg)" +[ -r /proc/pressure/io ] && \ + b psi_io_some_avg10_end "$(awk '/^some/ {for(i=1;i<=NF;i++) if($i ~ /^avg10=/) {sub("avg10=","",$i); print $i; exit}}' /proc/pressure/io)" + # network: only when a server is provided if [ -n "${IPERF_SERVER:-}" ] && command -v iperf3 >/dev/null 2>&1; then NET=$(iperf3 -c "$IPERF_SERVER" -t 10 -P 4 -J 2>/dev/null | jq -r '.end.sum_received.bits_per_second' 2>/dev/null)