Add the protocol-comparison module
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerate every file under docs/output/. Needs a JDK and nothing else: protoc and the gRPC
|
||||
# codegen plugin resolve as Maven artifacts, and all three servers start inside the test JVM.
|
||||
#
|
||||
# The benchmark numbers are NOT deterministic. They are re-measured on every run and the ratios
|
||||
# between the three protocols are what the documentation quotes.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
LOG=/tmp/protocol-comparison-test.log
|
||||
|
||||
MAVEN_OPTS=${MAVEN_OPTS:--Xmx900m} mvn -B test > "$LOG" 2>&1
|
||||
|
||||
# Interleaved log lines from other contexts have to come out, or the transcripts are unreadable.
|
||||
clean() { grep -vE '^2026-|^\s*$|Initializing|Completed initialization'; }
|
||||
|
||||
sed -n '/=== one Quote, five fields/,/^JSON is /p' "$LOG" | clean > docs/output/payload-sizes.txt
|
||||
sed -n '/=== request\/response/,/^WebSocket /p' "$LOG" | clean > docs/output/request-response.txt
|
||||
sed -n '/=== server streaming, 50000/,/^WebSocket /p' "$LOG" | clean > docs/output/stream-throughput.txt
|
||||
{ grep -m1 '=== unbounded stream' "$LOG"; grep -m1 '^protocol ' "$LOG"
|
||||
grep -m1 '^RSocket *[0-9]' "$LOG"; grep -m1 '^gRPC *[0-9]' "$LOG"
|
||||
grep -m1 '^WebSocket *[0-9]' "$LOG"
|
||||
sed -n '/^RSocket is flat/,/JIT-compiled/p' "$LOG"; } > docs/output/backpressure.txt
|
||||
{ grep -m1 '=== gRPC server streaming' "$LOG"; grep -m1 '^handler ' "$LOG"
|
||||
grep -m1 '^plain onNext loop' "$LOG"; grep -m1 '^isReady() checked' "$LOG"; } \
|
||||
> docs/output/grpc-isready.txt
|
||||
|
||||
grep -E 'Tests run:.*in com\.ankurm' "$LOG" | sed 's/^\[INFO\] //' > docs/output/tests.txt
|
||||
|
||||
echo "regenerated:"; ls -1 docs/output/
|
||||
Reference in New Issue
Block a user