Repository navigation
Fix jfr-mcp event count, uncompressed pprof and thin-data regressions - #128
Merged
Merged
Conversation
jfr_open returned totalEvents: 0 while jfr_summary reported 4262 for the same recording. Open reads metadata only and the session counter is only incremented by typed handlers, which the MCP server never uses, so the zero was never a count. totalEvents is now null with a totalEventsNote in jfr_open and jafar://sessions, and null with a countsNote in jfr_list_types without scan. Clients reading totalEvents as a number will see the change. Verified: reproduced over stdio before the fix; JfrOpenEventCountTest failed before it. The full gate fails 13 tests, the same 13 by name as clean HEAD; none are in jfr-mcp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pprof_open failed with "Not in GZIP format" on raw protobuf profiles because the reader always assumed gzip. It now decides from the magic bytes, so the extension does not matter. Content that is neither gzip nor a protobuf Profile is rejected with "Not a pprof profile", which also keeps empty files from opening as empty profiles. The shell's PprofModule rejected the same files, so it now claims raw content when the extension matches and the first tag is valid. Verified: reproduced over stdio before the fix; the new PprofParserTest and PprofModuleTest cases failed before it. The full gate fails 13 tests, the same 13 by name as clean HEAD; none are in pprof-parser or pprof-shell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comparing 7 and 3 sample recordings raised WARNING regressions for frames going from 0 to 1 sample, because a single sample of 3 clears a percentage-point threshold. A frame regression now needs 30 samples in each recording, 5 samples of the frame in one of them, and a two-proportion z score of at least 3. Rate findings are gated on the same recording minimum. Thin data gets an INFO regression:insufficient-samples finding in place of regression:none. Frame rows gain significant and can have direction inconclusive; the result gains sufficientSamples and minSamplesPerRecording. Verified: reproduced over stdio before the fix (3 WARNINGs, now 0); JfrCompareThinDataTest failed before it. The full gate fails 13 tests, the same 13 by name as clean HEAD; none are in jfr-mcp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests expect no configured model, but picked up llm.model from ~/.config/jafar/llm.properties on any machine that has one, and failed. They now supply an empty settings file through the existing LlmConfig constructor. JAFAR_LLM_MODEL in the environment can still affect them. Verified: :shell-core:test --tests '*LlmConfigTest' passes, 11 tests with that settings file present; the 2 failures reproduced before the change. The full gate was not rerun with this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runsInParallelThreads allowed 10 seconds for two parses of test-ap.jfr and failed at that limit during a full gate with the published 179 MB recording, while passing in about 3 seconds alone. It also swallowed parser exceptions, so a failed parse could pass. The test now waits on futures with a 5 minute bound that only catches a hang, and parser exceptions fail it. Verified: passes alone in 2.2 s and in 10.41 s with 36 CPU-burning processes running. The full gate was not rerun with this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Combined JUnit Test Report
HTML Test ReportsRun artifacts: https://github.com/btraceio/jafar/actions/runs/41300861684
|
jbachorik
marked this pull request as ready for review
November 1, 2026 11:37
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Draft so CI can run the full gate, which takes about 44 minutes locally with the published recordings. CI passing on these commits flips it to ready.
jfr_openevent count (cd5b980):jfr_openreportedtotalEvents: 0wherejfr_summaryreported 4262. Open reads metadata only, so the count isn't known yet.totalEventsis nownullwith a note, injfr_open,jafar://sessionsandjfr_list_typeswithoutscan.Uncompressed pprof (
c38c932):pprof_openfailed withNot in GZIP formaton raw protobuf profiles. Both forms now open, detected from the magic bytes rather than the extension. Content that is neither is rejected withNot a pprof profile. The shell'sPprofModulegets the same fix.jfr_compareon thin data (6be8639): frames going from 0 to 1 sample raised WARNING regressions on 7 and 3 sample recordings. A frame regression now needs 30 samples in each recording, 5 samples of the frame in one of them, and a two-proportion z score of at least 3. These thresholds are my judgement; they aren't derived from data.Test reliability (
a1ab952,bc3b449):LlmConfigTestno longer reads the local settings file.runsInParallelThreadsno longer fails at a 10 second limit on a busy machine, and no longer swallows parser exceptions.How verified
Local runs on JDK 25, macOS, before merging current
main../gradlew spotlessCheck test shadowJar --continueat6be8639, with published recordingsjfr-mcptests were up to date from an earlier runspotlessCheck,LlmConfigTestandTypedJafarParserStabilityTestwith--rerun, after the last two commitsBUILD SUCCESSFUL: 11 and 4 tests, 0 failedrunsInParallelThreadswith 36 CPU-burning processesThe 3 failures in the first row are the two tests fixed here: 2 in
LlmConfigTest, 1 inrunsInParallelThreads.MCP over stdio on the built jar:
totalEvents: nullfrom open, 4262 fromjfr_summary.pprof_open,pprof_summaryandpprof_hotmethodson a raw profile, its gzipped copy and both with misleading extensions matched once session and path fields were dropped. The pre-fix jar failed on the two raw files.regression:insufficient-samples.Coverage notes
JfrOpenEventCountTest,JfrCompareThinDataTestand new cases inPprofParserTestandPprofModuleTestcover the fixes. InJfrCompareThinDataTest, four of the five tests first failed on a missing field, and only the first test and the rate-gate test were shown to catch the old behaviour.Not verified / known limitations
main, which is why this is a draft. The branch is 2 commits behindmain; a trial merge has no conflicts./jfr-analyzerflow hasn't been run against this build, only direct stdio calls.a1ab952overlaps with7fb23feonmain, which isolates all tests from local LLM config in Gradle. It's harmless, and still helps runners that don't go through Gradle, but can be dropped.countstays 0 injfr_list_typeswithoutscan;countsNotecovers it.CHANGELOG.mdis not updated.Breaking changes / migration
Tool output changes that clients may parse:
jfr_open,jafar://sessions, andjfr_list_typeswithoutscan:totalEventsgoes from a number tonull.totalEventsNoteandcountsNoteare new.jfr_compare:directioncan beinconclusive.significant,sufficientSamples,minSamplesPerRecordingand theregression:insufficient-samplesfinding are new, and that finding replacesregression:noneon thin data.pprof_open: new error text for invalid files.Skills in
btraceio/agent-pluginsthat readtotalEventsordirectionmay need updating; this hasn't been checked.Links
None.
🤖 Generated with Claude Code