Time Profile and Usage Profile: opt-in top-10 legend; optional region labels - #153
Merged
Conversation
Projections writes a .projrc next to any trace it opens (including test/hello.projrc after a local 'make test'), which shows up as untracked noise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The existing Legend menu items are easy to miss and list every entry above 0.5% of the total, which can be tens of lines. Add a "Show Legend (top 10)" checkbox to the control panel that opens a movable legend window capped at the 10 largest activities in the displayed range, each labeled with its percentage of total time. Idle and Overhead are omitted from the compact legend: their colors are fixed and familiar to viewers. Unchecking the box (or closing the window, which unchecks it) dismisses the legend, and loading a new time/PE range refreshes it in place. The Legend menu still shows the full list including Idle and Overhead. To support this, Legend moves to projections.gui as a public class usable by other tools, gains a window title, and exposes getFrame()/dispose() so callers can manage its lifecycle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same feature as the Time Profile legend: a "Top 10" checkbox (in a titled panel matching the Grid control) opens a movable legend window listing the 10 largest activities ranked by average utilization over the selected PEs, matching the Avg bar. IDLE is omitted since its color is fixed and familiar; PACKING and UNPACKING remain eligible. The legend refreshes when a new range is loaded or colors change, and closing the window unchecks the box. Also fix actionPerformed to check which checkbox fired instead of assuming any JCheckBox event is the grid toggle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a "Label Large Regions" checkbox (opt-in, independent of the legend so exported images can use either or both). When enabled, any entry method whose utilization share stays at or above 25 percentage points for at least 1/20 of the displayed intervals gets its shortened name drawn at the center of that run, vertically centered in its stacked band. Labels are drawn in black with a white halo so they read on any region color, are truncated with an ellipsis in narrow regions, and are skipped entirely when almost nothing fits. Entry methods labeled on the chart are omitted from the compact top-10 legend to free slots for smaller activities; the Legend menu's full list is unaffected. Labels recompute on range reload and toggle off cleanly. The drawing support is a reusable Graph.setRegionLabels() hook in projections.gui.graph.Graph, following the setMarkers() pattern, so other stacked-graph tools can adopt it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plain text reads cleaner than haloed text. Draw region labels in black on light regions and white on dark ones (perceived-luminance test on the EP color, which RegionLabel now carries). Also shorten the checkbox text to "Label Regions". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Selection into the top-10 legend is still by total time, but the entries are displayed in order of their utilization-weighted mean interval (time centroid), so for phase-like entry methods the legend reads top-to-bottom in the same order the phases appear left-to-right in the chart. An entry method active throughout the run lands near the middle, which is benign. The Legend menu's full list stays sorted by size. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ritvikrao
self-requested a review
July 27, 2026 14:27
ritvikrao
previously approved these changes
Jul 27, 2026
ritvikrao
self-requested a review
July 27, 2026 18:06
ritvikrao
approved these changes
Jul 27, 2026
ritvikrao
pushed a commit
that referenced
this pull request
Jul 27, 2026
The #153 squash fixed the file format (owners must share one line; with separate "*" lines only the last one counts) but dropped matthiasdiener, who continues to contribute and review. Add ericjbohm, a regular reviewer, as well. All four are co-owners: any of them is auto-requested for review on every PR. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Graph.setRegionLabels()hook following the existingsetMarkers()pattern.actionPerformedto check which checkbox fired instead of assuming any checkbox event is the grid toggle. (No region labels here: per-processor bars are too narrow for on-chart text.)Legendmoves fromprojections.Tools.TimeProfiletoprojections.guias a public class so both tools (and future ones) can use it; it gains a window title andgetFrame()/dispose()for lifecycle management. Its rendering is unchanged, including click-to-save-PNG.*.projrc(written by Projections next to any opened trace, e.g.test/hello.projrcafter a localmake test) and.DS_Store.Testing
Built with
gradle copyJarToBin(JDK 17) and exercised against a 120-PE trace: both tools' legends show the top-10 with percentages, follow range reloads, restore their position on refresh, and keep the checkbox in sync when the window is closed directly. The Time Profile legend lists phases in left-to-right chart order. Region labels appear on the dominant phases with contrast-appropriate text color, truncate in narrow regions, recompute on range reload, toggle off cleanly, and remove their EPs from the legend while active. The Legend menu behavior in Time Profile is unchanged.🤖 Generated with Claude Code