Repository navigation
Add top and summarize: ranked tables and an analysis digest - #12
Merged
Merged
Conversation
This was referenced Sep 23, 2026
lhotari
added this pull request to stack #14
September 23, 2026 20:16
lhotari
removed this pull request from stack #14
September 23, 2026 20:17
lhotari
force-pushed
the
top-and-digest
branch
from
September 23, 2026 20:22
d5a0908 to
1c8e5f3
Compare
lhotari
added this pull request to stack #15
September 23, 2026 20:22
lhotari
force-pushed
the
top-and-digest
branch
from
September 23, 2026 20:26
1c8e5f3 to
1224dc7
Compare
Deciding what to optimize from a capture took a DuckDB session and six scripts in the Apache Pulsar analysis: attribute each wait to the deepest application frame and the lock below it, set idle waits apart without losing them, break the rest down by thread pool, and compare runs per unit of work. The correlator now does that itself. - top ranks a profile (or any collapsed file) with the selection, filter and transform options of stacks. An interval is idle when a frame of any of its stacks matches --idle/--idle-from, busy otherwise; idle time gets its own table instead of disappearing. --by boundary (the default) keys busy rows by the deepest --app frame and its blocker, the entry frame of the wait machinery below it (--machinery-from, default preset:jvm-wait-machinery), and breaks busy time without an application frame down by thread pool. --by self, method, class, package and pool rank otherwise. Every total adds up, and an over-exclusion check counts idle entries that still waited on a lock or monitor. - Columns: seconds, share, intervals, estimated seconds and the sleeping/run-queue split when the profile has them, the dominant reason and the heaviest caller. --format md|json|csv; JSON is the source and names the command that reproduces it. - top --baseline compares two runs by application boundary, per unit of work with --units/--baseline-units. It warns when observed time is length-biased by sampling and when the runs' native symbolization differs, and refuses observed weights when both runs have estimates. - summarize writes jonoffcpu-summary.json and .md: the capture's coverage and losses from the report, where the time went, the busy, pool and idle tables, the heaviest transformed stacks, and each table's reproduce command. The Markdown is rendered from the JSON. Correlation writes it by default (--summary-output false skips it); a failure to write it is recorded in the report's digest object and never fails the correlation. On the Pulsar broker fixtures every number of the spec's worked example and comparison is reproduced exactly: 2,131 busy entries, 7,388 intervals, 48.968 s, of which 28.374 s has no application frame (ZDriverMinor 22.517 s, ZDriverMajor 5.527 s); internalConsumerFlow on C2 Runtime complete_monitor_locking 11.982 s / 4,245 at the top; an over-exclusion of 18 entries, 0.047 s; and Alpine against Wolfi 2.034 vs 2.396 s per million messages. top's boundary rows agree with stacks --leaf-at on all 57 boundaries, and the digest's Markdown is 15,841 bytes.
lhotari
force-pushed
the
top-and-digest
branch
from
September 23, 2026 20:37
1224dc7 to
3c09175
Compare
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.
Third PR of the 0.5.0 correlator stack (GitHub stack #15; spec:
top-and-digest.md). Based on #11 (export).What changes
topranks where off-CPU time went. It works on a--profileor any--collapsed-inputand shares the selection, filter and transform options ofstacks.--idle/--idle-from(e.g.preset:jvm-idle) and busy otherwise. Idle time gets its own table instead of disappearing.--by boundary(default): deepest--appframe + blocker, the entry frame of the wait machinery below it (--machinery-from, defaultpreset:jvm-wait-machinery). Busy time without an application frame is broken down by thread pool.--by self|method|class|package|poolrank the other ways.--format md|json|csv. JSON is the source and includes the reproduce command; md and csv are rendered from it.top --baselinecompares two runs by application boundary, per unit of work with--units/--baseline-units. It warns when shares are length-biased (sampled runs without estimates) and when the runs' native symbolization differs. It refuses observed weights when both runs have estimates.summarizeand the digestjonoffcpu-summary.{md,json}(schema v1):--summary-output falseskips it). A failure goes into the report'sdigest.errorand never fails the correlation.Verification
./gradlew spotlessCheck :jonoffcpu-correlator:check -PjonoffcpuFixtures=…passes.testFixtureAcceptance):internalConsumerFlow+C2 Runtime complete_monitor_locking11.982 s / 4,245.ZDriverMinor22.517 s (88) andZDriverMajor5.527 s (27).[no application frame]7,687.8 s,internalTakeAll231.2 s, and so on.topagrees withstacks --leaf-at '^org\.apache\.'on all 57 boundaries.TopTestcovers the spec's unit cases:--by methodcounting recursion once--weights estimatedrefused without an estimate, and the--baselinewarningChoices the spec left open
^java\.util\.concurrent\.locks\..*\.(lock|acquire)\w*$|complete_monitor_locking. Of the definitions tried, it is the one that yields the spec's 18 / 18 / 0.047 s.isDuplicateNormal0.161 s/M = 0.805 s) only match that way./lib/…frame.--canonical-names, so callers read$$Lambda.run. Its heaviest stacks use--package-names drop, like the spec's…example, which keeps the Markdown under 16 KB. Both options appear in its reproduce commands.top --by boundarywithout--appis a usage error pointing to--by self.summarize, like the correlation default, falls back to--by selfafter--collapse-leaf.accountedLossis shown in the digest's capture section when the report has it (Account for counted sequence contention in population estimates #9).