mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valera V Harseko
3 days ago 9a666b7b8658ddc9ebaae3c7588c06a9e9155309
Fix benchmark charts: non-overlapping columns and total throughput

Two report fixes in summary.sh.

- Make the per-operation columns actually render side by side. xychart-beta
merges duplicate x-axis category labels into one slot, so the previous
"ADD","ADD" axis collapsed both series back onto a single column and the
OpenLDAP/OpenDJ bars overlapped. Use distinct labels ("ADD OL","ADD DJ", ...)
so the zero-padded series stay on separate columns.
- Replace per-operation throughput with a single total-throughput comparison.
In a sequential loop every operation runs once per iteration, so per-op
throughput just equals the loop rate (nearly identical across ops, which
looked wrong). The per-operation table now shows latency only (mean/p99/
errors); a two-bar chart shows total OpenLDAP vs OpenDJ throughput, with a
note explaining why per-op throughput is not charted.

Verified by rendering the report from the real run's statistics.json artifacts.
1 files modified
32 ■■■■■ changed files
.github/benchmark/summary.sh 32 ●●●●● patch | view | raw | blame | history
.github/benchmark/summary.sh
@@ -70,14 +70,13 @@
echo ""
# ---------------------------------------------------------------- Per-op table
echo "### Per-operation comparison"
echo "### Per-operation latency"
echo ""
echo "| Operation | ops/s OpenLDAP | ops/s OpenDJ | mean ms OpenLDAP | mean ms OpenDJ | p99 ms OpenLDAP | p99 ms OpenDJ | err OL | err DJ |"
echo "|---|--:|--:|--:|--:|--:|--:|--:|--:|"
echo "| Operation | mean ms OpenLDAP | mean ms OpenDJ | p99 ms OpenLDAP | p99 ms OpenDJ | err OL | err DJ |"
echo "|---|--:|--:|--:|--:|--:|--:|"
for op in "${OPS[@]}"; do
  printf '| %s | %s | %s | %s | %s | %s | %s | %s | %s |\n' \
  printf '| %s | %s | %s | %s | %s | %s | %s |\n' \
    "$op" \
    "$(m  "$OL_JSON" "$op" throughput)"   "$(m  "$DJ_JSON" "$op" throughput)" \
    "$(m  "$OL_JSON" "$op" meanResTime)"  "$(m  "$DJ_JSON" "$op" meanResTime)" \
    "$(mi "$OL_JSON" "$op" pct3ResTime)"  "$(mi "$DJ_JSON" "$op" pct3ResTime)" \
    "$(mi "$OL_JSON" "$op" errorCount)"   "$(mi "$DJ_JSON" "$op" errorCount)"
@@ -89,10 +88,13 @@
# columns per operation we repeat each op on the x-axis and zero-pad the two series: OpenLDAP
# bars land on the left tick of each pair, OpenDJ on the right tick.
#
# x-axis: each op twice -> "ADD", "ADD", "SEARCH", "SEARCH", ...
# x-axis: each op as two *distinct* labels -> "ADD OL", "ADD DJ", "SEARCH OL", ...
# The labels MUST be unique: xychart-beta merges duplicate category labels into one slot, which
# would put both series back on the same column (overlapping). Distinct labels keep the columns
# separate so the zero-padded series render side by side.
xaxis_pairs() {
  local out="" op
  for op in "${OPS[@]}"; do out+="${out:+, }\"${op}\", \"${op}\""; done
  for op in "${OPS[@]}"; do out+="${out:+, }\"${op} OL\", \"${op} DJ\""; done
  printf '%s' "$out"
}
# OpenLDAP series: value then 0 per op (bar on the left tick of each pair).
@@ -113,19 +115,21 @@
PALETTE='%%{init: {"themeVariables": {"xyChart": {"plotColorPalette": "#4e79a7, #f28e2b"}}}}%%'
CAPTION="_Each operation has two columns: ๐ŸŸฆ OpenLDAP (left) ยท ๐ŸŸง OpenDJ (right)._"
# ---------------------------------------------------------------- Throughput chart
echo "### Comparative chart โ€” throughput per operation (ops/s, higher is better)"
# ---------------------------------------------------------------- Total throughput chart
echo "### Total throughput (ops/s, higher is better)"
echo ""
echo "$CAPTION"
echo "_๐ŸŸฆ OpenLDAP ยท ๐ŸŸง OpenDJ. Per-operation throughput is intentionally not charted: every"
echo "operation runs once per loop iteration, so each op's throughput just equals the loop rate"
echo "(nearly identical across ops). The meaningful throughput is the aggregate shown here._"
echo ""
echo '```mermaid'
echo "$PALETTE"
echo "xychart-beta"
echo "    title \"Throughput per operation (ops/s) โ€” OpenLDAP vs OpenDJ\""
echo "    x-axis [${XAXIS}]"
echo "    title \"Total throughput (ops/s) โ€” OpenLDAP vs OpenDJ\""
echo "    x-axis [\"OpenLDAP\", \"OpenDJ\"]"
echo "    y-axis \"ops/s\""
echo "    bar [$(series_ol m "$OL_JSON" throughput)]"
echo "    bar [$(series_dj m "$DJ_JSON" throughput)]"
echo "    bar [${ol_tot_tp}, 0]"
echo "    bar [0, ${dj_tot_tp}]"
echo '```'
echo ""