Skip to content

Support gungraun json format - #962

Open
gamma0987 wants to merge 6 commits into
bencherdev:develfrom
gamma0987:support-gungraun-json-format
Open

Support gungraun json format#962
gamma0987 wants to merge 6 commits into
bencherdev:develfrom
gamma0987:support-gungraun-json-format

Conversation

@gamma0987

Copy link
Copy Markdown
Contributor

This PR adds a gungraun JSON v6 adapter to complement the existing text-based gungraun parser, enabling users to consume machine-readable output directly.

What changed:

  • Fixes the missing DHAT metrics also for the text-based gungraun parser in rust/gungraun.rs.
  • New AdapterRustGungraunJson in lib/bencher_adapter/src/adapters/rust/gungraun_json.rs
  • Uses gungraun-summary to parse the JSON format. These are the types directly exported from gungraun. This eliminates the error source and additional work parsing the JSON manually in bencher.
  • Uses gungraun_summary::util::parse_slice() for version-aware parsing (only v6 currently)
  • Parses NDJSON input: one benchmark summary per line. This is the default gungraun JSON format. gungraun can print in pretty JSON, but parsing that format is not covered in this pr.
  • Supports all 8 Gungraun tools with complete metric coverage. 2 tools (Massif and BBV) don't produce metrics and return an empty vector of GungraunMeasure(s). Massif and BBV return empty benchmark vectors, which afaik surface in the UI with a warning if they are the only tools.
  • Rejects Mean/Median averaging like the text-based gungraun parser
  • Registers a new rust_gungraun_json adapter in addition to the existing rust_gungraun adapter

Documentation updates are intentionally deferred to a follow-up PR.

Note on benchmark naming and ids:
Already discussed in #778. This parser implementation uses (file::group::function + ::id) and the optional id as benchmark name to identify gungraun benchmarks uniquely. In addition to #778, I want to add that the main problem is that text parsed benchmark names include the "most likely" truncated BenchmarkSummary::details. Exactly replicating the text parsed benchmark name is impossible because the user can disable or change the truncation length with configuration values. The JSON summary doesn't reflect that decision and doesn't store the user provided truncation configuration value. Required follow-up PR: A database migration to convert the old benchmark names to the new ones. Changing the old names to the new names is straightforward but irreversible although I don't think there's any need to go back.

Closes #638

@socket-security

socket-security Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcargo/​gungraun@​0.18.0 ⏵ 0.19.482 +510096100100
Addedcargo/​gungraun-summary@​6.0.0100100100100100

View full report

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBencher
Branchsupport-gungraun-json-format
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
4.68 µs
(+0.06%)Baseline: 4.68 µs
5.00 µs
(93.72%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
4.61 µs
(+1.55%)Baseline: 4.54 µs
4.81 µs
(95.94%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
25.70 µs
(-0.15%)Baseline: 25.74 µs
26.98 µs
(95.24%)
Adapter::Rust📈 view plot
🚷 view threshold
3.52 µs
(-0.23%)Baseline: 3.53 µs
3.93 µs
(89.63%)
Adapter::RustBench📈 view plot
🚷 view threshold
3.52 µs
(-0.32%)Baseline: 3.53 µs
3.93 µs
(89.46%)
🐰 View full continuous benchmarking report in Bencher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant