[Feature] Read JMH JSON benchmark results in `evidence add`

Open
#6,337 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Papito084 is already working on this.

Since Nov 26, 2026.

  • #6381 by @Papito084 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Read packages/core/src/repowise/core/evidence/profile_formats/__init__.py and pytest_benchmark.py for format registration and conversion patterns, then inspect the JMH JSON fields described in the issue. The issue names tests/unit/evidence/ for coverage. Done means a JMH fixture with thrpt and avgt results ingests with correct directions, units, and benchmark function names; linked PR #6381 is already open.

Written by the indexing model from the issue text.

Description

enhancement help wanted

Summary

evidence add reads pytest-benchmark, Go bench and hyperfine results, but not JMH's -rf json output, the common benchmark format on the JVM.

packages/core/src/repowise/core/evidence/profile_formats/__init__.py:77-91

profile_formats.register("hyperfine", ProfileFormat(hyperfine.sniff, to_v1=hyperfine.to_v1))
profile_formats.register("junit", ProfileFormat(junit.sniff, to_v1=junit.to_v1))

Mechanism

  • A format is one module with sniff and to_v1 plus one register call (module docstring, :1-25). pytest_benchmark.py is the closest precedent: one series per benchmark, function set when the name leads to a symbol.
  • JMH writes a JSON array. Each item has benchmark (com.acme.CartBench.total), mode (thrpt, avgt, sample, ss) and primaryMetric with score, scoreError and scoreUnit.
  • Open PR #6237 resolves JVM package-qualified names in ingest.resolve_location, which a function of com.acme.CartBench.total can use.

Repro

A one-result JMH file ([{"jmhVersion":"1.37","benchmark":"com.acme.CartBench.total","mode":"avgt",...}]) through input_format and prepare_evidence, as evidence add runs them:

jmh.json detected: repowise-evidence-v1
   EvidenceRefusedError: the file is not a JSON object

Done looks like

  • New profile_formats/jmh.py. Sniff a JSON array whose first item has jmhVersion and benchmark.
  • One series per benchmark and mode. thrpt is higher-is-better (ops per time unit), avgt/sample/ss are lower-is-better. Convert units to the series unit.
  • function is the benchmark method's FQN.
  • Must not change: sniff order for other JSON formats.

Tests

tests/unit/evidence/: a fixture with one thrpt and one avgt result ingests with the right direction and units.

Dominant language
Python
Stars
7.1k
Forks
756
Avg merge
21h 5m
Merged PRs (30d)
797

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from repowise-dev/repowise

All issues in repowise-dev/repowise

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.