Skip to content

Structured breakout API, regex filter, and aggregation support#184

Merged
atheurer merged 1 commit intomasterfrom
web-ui-refinements
Apr 28, 2026
Merged

Structured breakout API, regex filter, and aggregation support#184
atheurer merged 1 commit intomasterfrom
web-ui-refinements

Conversation

@atheurer
Copy link
Copy Markdown
Contributor

Summary

  • Add parseBreakoutEntry() to server — accepts both legacy string format ("cpu=0+1+2") and new structured object format ({ name, values[], regex, aggregate }) with backward compatibility
  • Replace all 6 inline string-parsing locations in cdm.js with centralized parseBreakoutEntry() calls
  • Fix remainingBreakouts filtering bug (was comparing field names against raw encoded strings)
  • Add regex text input in breakout dropdown with live chip auto-selection
  • Add "Sum" checkbox for aggregating selected breakout values into a single combined metric
  • Build compact aggregate labels: numeric ranges (0-11), comma lists, or N values fallback
  • Move Dive checkbox into Y-axis label for consistent placement across all metric panels
  • Fix deep dive var closure bug that stored metric data under wrong key when multiple metrics selected
  • Add render yield between sequential deep dive metric fetches

Test plan

  • Existing breakout workflows still work (click "all", select individual values, Add)
  • Type regex in breakout dropdown — matching chips auto-select in real-time
  • Invalid regex shows red border, no crash
  • Select values + check "Sum" + Add — single aggregated bar appears instead of separate bars
  • Aggregated metric label shows compact range (e.g., 0-11) in values-legend
  • Values-legend column order matches header order for aggregated breakouts
  • Dive checkbox appears on Y-axis label for both primary and supplemental metrics
  • Deep dive with multiple metrics — each metric renders in correct panel, data appears sequentially
  • get-metric-data.js CLI still works with old string format breakouts

🤖 Generated with Claude Code

Server (cdm.js):
- Add parseBreakoutEntry() to accept both legacy string and structured
  object format: { name, values[], regex, aggregate }
- Replace all 6 inline string-parsing locations with parseBreakoutEntry()
- Fix remainingBreakouts filtering (was comparing field names against
  raw breakout strings, now compares against parsed names)
- Add buildAggregateLabel() for compact aggregate labels: numeric ranges
  (0-11), comma lists, or "N values" fallback at 30-char cap
- Insert synthetic label segments at correct position for aggregated
  breakouts so values-legend column order matches headers

Client (CompareView.jsx):
- Breakout dropdown sends structured objects instead of encoded strings
- Add regex text input per breakout dimension with live chip auto-selection
- Add "Sum" checkbox to aggregate selected values into one metric
- Move Dive checkbox into Y-axis label for consistent placement
- Handle object breakout entries in renderGroupedBreakouts and chip display

Client (DeepDiveView.jsx):
- Fix var closure bug: capture metricKey before setMetricData updater
  to prevent data being stored under wrong metric key
- Handle object breakout entries in breakoutNames extraction
- Add setTimeout yield between metrics for sequential rendering

Server logging (server.js):
- Fix breakout logging for object entries in /metric-data endpoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@atheurer atheurer merged commit e39a0ac into master Apr 28, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Crucible Tracking Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants