From 8445191ba781bc2693333734a3f00c7f9e4f7047 Mon Sep 17 00:00:00 2001 From: Xiaoyumuxi <3075514079@qq.com> Date: Mon, 14 Sep 2026 17:10:52 +0800 Subject: [PATCH 1/2] docs: add RPC performance history --- docs/PERFORMANCE.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/PERFORMANCE.md diff --git a/docs/PERFORMANCE.md b/docs/PERFORMANCE.md new file mode 100644 index 0000000..cd4d4e8 --- /dev/null +++ b/docs/PERFORMANCE.md @@ -0,0 +1,37 @@ +# RPC Performance History + +该文档由 CI 持续维护,用于记录 Java-RPC 真实端到端调用链路的性能快照。 + +> 这些数据来自 GitHub Hosted Runner,适合观察趋势和发现明显回归,不作为绝对性能承诺或硬性合并门槛。测试固定使用 Local Registry + Netty + Kryo,并保持固定 warmup、请求量和并发度以提高不同运行之间的可比性。 + +## 测试配置 + +- Warmup:100 次 RPC +- 顺序阶段:200 次 RPC,并发度 1 +- 并发阶段:1000 次 RPC,并发度 16 +- Registry:`local` +- Protocol:`netty` +- Serializer:`kryo` +- 记录指标:吞吐、Avg、P50、P95、P99、Max,以及 Client / Server 内置 metrics + +## 历史记录 + +### PR #11 CI 基线 + +- Commit: `281d526ebe6ccd0e970453fc9094b85bf08cfe96` +- Java: `17.0.20.1` +- CPU visible to JVM: `4` + +| Phase | Requests | Concurrency | Throughput req/s | Avg ms | P50 ms | P95 ms | P99 ms | Max ms | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| sequential | 200 | 1 | 482.033 | 2.066 | 1.535 | 4.578 | 6.195 | 9.340 | +| concurrent | 1000 | 16 | 1537.520 | 10.250 | 9.376 | 17.876 | 22.806 | 27.916 | + +#### Framework metrics + +| Phase | Side | Total | Success | Failed | Timeout | Active | Metric avg ms | Metric max ms | +| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| sequential | CLIENT | 200 | 200 | 0 | 0 | 0 | 1.832 | 7.988 | +| sequential | SERVER | 200 | 200 | 0 | 0 | 0 | 0.240 | 3.970 | +| concurrent | CLIENT | 1000 | 1000 | 0 | 0 | 0 | 9.692 | 25.216 | +| concurrent | SERVER | 1000 | 1000 | 0 | 0 | 0 | 0.661 | 12.092 | From baf42de8a0cff6280a0e80fd21fc8e3a5f612723 Mon Sep 17 00:00:00 2001 From: Xiaoyumuxi <3075514079@qq.com> Date: Mon, 14 Sep 2026 17:11:11 +0800 Subject: [PATCH 2/2] ci: persist performance snapshots in markdown history --- .github/workflows/ci.yml | 91 ++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c748b1..7cb1e5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: push: branches: [ main ] + paths-ignore: + - 'docs/PERFORMANCE.md' pull_request: branches: [ main ] @@ -70,6 +72,8 @@ jobs: name: RPC Integration runs-on: ubuntu-24.04 timeout-minutes: 10 + outputs: + performance_markdown: ${{ steps.performance-record.outputs.markdown }} steps: - name: Checkout code @@ -92,8 +96,8 @@ jobs: -Drpc.protocol=netty # Performance data is observational only. Hosted Runner variance makes absolute - # latency/QPS unsuitable as a merge threshold, but every run publishes the raw - # samples and summary so regressions can be inspected over time. + # latency/QPS unsuitable as a merge threshold. PR CI validates the snapshot; + # successful main CI runs persist the result into docs/PERFORMANCE.md. - name: Run RPC performance snapshot run: >- mvn -B -ntp test @@ -108,28 +112,22 @@ jobs: -Drpc.perf.concurrent-requests=1000 -Drpc.perf.concurrency=16 - - name: Publish RPC performance summary - if: always() + - name: Prepare performance record + id: performance-record shell: bash run: | - if [[ -f rpc-consumer/target/rpc-performance/summary.md ]]; then - cat rpc-consumer/target/rpc-performance/summary.md >> "$GITHUB_STEP_SUMMARY" - else - { - echo "# RPC CI Performance Snapshot" - echo - echo "No performance snapshot was generated. Check the test logs for the failure cause." - } >> "$GITHUB_STEP_SUMMARY" - fi - - - name: Upload RPC performance snapshot - if: always() - uses: actions/upload-artifact@v7 - with: - name: rpc-performance-snapshot - retention-days: 30 - if-no-files-found: warn - path: rpc-consumer/target/rpc-performance/ + summary='rpc-consumer/target/rpc-performance/summary.md' + test -f "$summary" + { + echo 'markdown< Observational snapshot only\./d' \ + -e '/^Raw per-request samples are available/d' \ + -e 's/^## Framework metrics$/### Framework metrics/' \ + "$summary" + echo 'RPC_PERFORMANCE_EOF' + } >> "$GITHUB_OUTPUT" - name: Upload integration test reports if: always() @@ -140,6 +138,55 @@ jobs: if-no-files-found: warn path: '**/target/surefire-reports/' + record-performance: + name: Record Performance + if: >- + github.event_name == 'push' && + github.ref == 'refs/heads/main' && + needs.rpc-integration.result == 'success' + needs: [ rpc-integration ] + runs-on: ubuntu-24.04 + timeout-minutes: 5 + permissions: + contents: write + + steps: + - name: Checkout main + uses: actions/checkout@v7 + with: + ref: main + fetch-depth: 0 + + - name: Append performance snapshot + shell: bash + env: + PERFORMANCE_MARKDOWN: ${{ needs.rpc-integration.outputs.performance_markdown }} + run: | + test -n "$PERFORMANCE_MARKDOWN" + mkdir -p docs + test -f docs/PERFORMANCE.md + + short_sha="${GITHUB_SHA:0:7}" + recorded_at="$(date -u '+%Y-%m-%d %H:%M:%S UTC')" + + { + echo + echo '---' + echo + echo "## CI Snapshot — ${recorded_at} — \`${short_sha}\`" + echo + printf '%s\n' "$PERFORMANCE_MARKDOWN" + } >> docs/PERFORMANCE.md + + - name: Commit performance history + shell: bash + run: | + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add docs/PERFORMANCE.md + git commit -m 'docs: record RPC performance snapshot [skip ci]' + git push origin HEAD:main + ci-gate: name: CI Gate if: always()