Skip to content

feat(java): add reporting suite to java bench#3420

Open
slbotbm wants to merge 4 commits into
apache:masterfrom
slbotbm:java-benchmarking-3
Open

feat(java): add reporting suite to java bench#3420
slbotbm wants to merge 4 commits into
apache:masterfrom
slbotbm:java-benchmarking-3

Conversation

@slbotbm
Copy link
Copy Markdown
Contributor

@slbotbm slbotbm commented Jun 4, 2026

Which issue does this PR address?

Closes #
Relates to #

Rationale

The java bench was missing a reporting suite, which meant no metrics collection was happening.

What changed?

bench/
├── benchmarks
│   ├── actors
│   │   └── tcp
│   │       └── async
│   │           └── TcpAsyncPinnedProducerActor.java
│   │               # now collects benchmark records, tracks send progress and latency,
│   │               # returns IndividualMetrics, and logs producer benchmark lifecycle/summary data.
│   └── runners
│       └── tcp
│           └── async
│               └── TcpAsyncPinnedProducer.java
│                   # now runs actors, collects IndividualMetrics, builds GroupMetrics,
│                   # and exposes report data
├── cli
│   ├── IggyBenchCommand.java
│   │   # increased the default warmup time from 20 seconds to 60 seconds to better warm up the JVM.
│   └── PinnedProducerCommand.java
│       # builds benchmark/report metadata, constructs and writes the final report,
│       # and prints a summary.
├── common
│   └── enums
│       ├── BenchmarkKind.java
│       │   # added pretty human-readable benchmark names.
│       └── TimeSeriesKind.java
│           # defines the time-series categories used in reporting.
├── models
│   └── report
│       ├── FinalReport.java
│       │   # top-level immutable report record.
│       ├── context
│       │   ├── BenchmarkCacheMetrics.java
│       │   │   # value record for server cache hit/miss statistics.
│       │   ├── BenchmarkCacheMetricsKey.java
│       │   │   # key record for per-partition cache metrics.
│       │   ├── BenchmarkHardware.java
│       │   │   # hardware metadata record for the benchmark host.
│       │   ├── BenchmarkParams.java
│       │   │   # report metadata record for benchmark topology, sizing, command, identifiers.
│       │   └── BenchmarkServerStats.java
│       │       # server-side stats record.
│       └── metrics
│           ├── BenchmarkRecord.java
│           │   # raw per-sample benchmark record used as the input to metrics calculation.
│           ├── DistributionPercentiles.java
│           │   # percentile summary record for latency distributions.
│           ├── GroupMetrics.java
│           │   # aggregate metrics record for a group of actors plus optional latency distribution.
│           ├── GroupMetricsSummary.java
│           │   # numeric summary of aggregate throughput and latency metrics.
│           ├── HistogramBin.java
│           │   # histogram bin record for latency distributions.
│           ├── IndividualMetrics.java
│           │   # per-actor metrics record containing summary, time series,
│           │   # and non-serialized raw latency samples.
│           ├── IndividualMetricsSummary.java
│           │   # numeric summary record for one actor's benchmark results.
│           ├── LatencyDistribution.java
│           │   # latency distribution record combining histogram bins,
│           │   # log-normal parameters, and percentile markers.
│           ├── LatencyMetrics.java
│           │   # internal holder for computed latency statistics.
│           ├── LogNormalParams.java
│           │   # record for log-normal distribution parameters.
│           ├── TimePoint.java
│           │   # simple time/value point record used by report time series.
│           └── TimeSeries.java
│               # time-series record with typed series kind and an empty-series helper.
└── report
    ├── FinalReportBuilder.java
    │   # assembles the final report, serializes it as JSON,
    │   # writes it to disk, and prints generic benchmark/group summaries.
    ├── GroupMetricsCalculator.java
    │   # aggregates per-actor metrics into group throughput/latency summaries,
    │   # time series, and latency distributions.
    ├── HardwareInfoCollector.java
    │   # collects local machine hardware details such as CPU name/core count,
    │   # memory, OS name/version, and optional hostname identifier.
    ├── IndividualMetricsCalculator.java
    │   # converts raw BenchmarkRecord samples into per-actor throughput/latency summaries
    │   # and time series.
    ├── ServerStatsCollector.java
    │   # collects benchmark server stats through the admin client
    │   # and maps cache metrics into report models.
    └── StatsHelper.java
        # helper math for means, extrema, standard deviation,
        # moving averages, and percentile interpolation.

Local Execution

  • Passed
  • Pre-commit hooks

AI Usage

If AI tools were used, please answer:

  1. Which tools? codex
  2. Scope of usage? code generated
  3. How did you verify the generated code works correctly? read through the code and verified multiple times.
  4. Can you explain every line of the code if asked? yes

@slbotbm slbotbm marked this pull request as draft June 4, 2026 05:05
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-review PR is waiting on a reviewer labels Jun 4, 2026
@slbotbm
Copy link
Copy Markdown
Contributor Author

slbotbm commented Jun 4, 2026

I still need to verify some more things, so I converted this to a draft for now. Preliminary results of running the two benches are as follows:

Commands ran:
Java:

taskset -c 0-3 ./target/debug/iggy-server --fresh --with-default-root-credentials
taskset -c 4-7 ./gradlew --no-daemon :iggy-bench:run --args="pp"

Rust:

taskset -c 0-3 ./target/debug/iggy-server --fresh --with-default-root-credentials
taskset -c 4-7 ./target/debug/iggy-bench --warmup-time 60s pp tcp output -o .

Results:

Metric Java Rust
Total Throughput 58.80 MB/s 65.33 MB/s
Messages/s 58,782 65,308
Avg Throughput / Producer 7.35 MB/s 8.17 MB/s
p50 Latency 74.18 ms 74.07 ms
p90 Latency 243.74 ms 205.46 ms
p95 Latency 497.91 ms 307.11 ms
p99 Latency 1,661.16 ms 1,466.63 ms
p999 Latency 6,420.36 ms 6,776.00 ms
p9999 Latency 8,243.68 ms 7,800.65 ms
Avg Latency 155.02 ms 140.63 ms
Median Latency 74.18 ms 74.07 ms
Min Latency 3.13 ms 2.10 ms
Max Latency 13,927.95 ms 9,637.32 ms
Std Dev 183.00 ms 175.81 ms
Total Time 184.15 s 158.94 s

Generated reports:
Rust: rust-report.json
Java: java-report.json

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.60%. Comparing base (d254604) to head (8cf0ad1).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3420      +/-   ##
============================================
+ Coverage     74.43%   74.60%   +0.16%     
  Complexity      943      943              
============================================
  Files          1245     1229      -16     
  Lines        121293   121022     -271     
  Branches      97599    97573      -26     
============================================
  Hits          90285    90285              
+ Misses        28054    27783     -271     
  Partials       2954     2954              
Components Coverage Δ
Rust Core 75.56% <ø> (ø)
Java SDK 62.30% <ø> (+3.86%) ⬆️
C# SDK 69.92% <ø> (ø)
Python SDK 81.06% <ø> (ø)
PHP SDK 83.57% <ø> (ø)
Node SDK 91.35% <ø> (ø)
Go SDK 40.20% <ø> (ø)
see 16 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@slbotbm slbotbm force-pushed the java-benchmarking-3 branch from 2596ca3 to 8cf0ad1 Compare June 6, 2026 09:16
@slbotbm slbotbm marked this pull request as ready for review June 6, 2026 09:20
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant