Skip to content

feat(frontend): add toggleable performance heat-map overlay#6213

Open
PG1204 wants to merge 6 commits into
apache:mainfrom
PG1204:feat/workflow-performance-heatmap
Open

feat(frontend): add toggleable performance heat-map overlay#6213
PG1204 wants to merge 6 commits into
apache:mainfrom
PG1204:feat/workflow-performance-heatmap

Conversation

@PG1204

@PG1204 PG1204 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds a toggleable, canvas-level performance heat-map overlay (Layers -> Performance) that colors operators cold -> hot from the per-operator metrics captured in #5773. A read-only consumer of existing data and no backend
changes
.

  • Three views with bottleneck-oriented scoring:
    • Runtime: data + control processing time (matches the backend cost model)
    • Throughput: seconds per output row (slow producers are hotter)
    • I/O imbalance: |out − in| / (out + in), bounded to [0, 1] so an extreme amplifier can't dominate the scale
  • Scoring/color helpers (pure, unit-tested): rawMetricForView, normalizeScores (log1p + min-max), scoreToColor (colorblind-safe ramp)
  • Overlay layer modeled on the existing Grid/Regions/Workers pattern: a BehaviorSubject view stream on JointGraphWrapper, applied by the editor to the shared model (canvas + mini-map)
  • Heat-map owns only the operator body fill, so it coexists with the execution-status border
  • Legend showing the active view and its real min/max value range
  • Hover tooltip with the operator's metric value + heat score
  • Live recolor as stats stream in; restores default fills when toggled off

Note on size: this is one cohesive sub-issue (#5774); roughly 40% of the diff is unit tests.

Any related issues, documentation, discussions?

Closes #5774. Part of umbrella #5772. Follows RFC discussion #5216.

How was this PR tested?

New Vitest specs (scoring, color, recolor methods, and the menu toggle):
cd frontend && ng test --watch=false --include "/heatmap-scoring.spec.ts" --include "/heatmap-color.spec.ts" --include "/joint-ui.service.spec.ts" --include "/menu.component.spec.ts"

Also verified: tsc --noEmit (strict) clean, eslint ./src clean, Prettier clean, ng build succeeds, and the existing workflow-editor/menu specs still pass.

Manually tested in the workspace: ran a workflow, toggled Performance on, switched all three views (recolor + legend range update), verified the hover tooltip, toggled off (fills restore), and confirmed the mini-map mirrors the colors.

UI screenshots
Before:
image

After:
image

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Anthropic Claude Opus 4.7)

@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @bobbai00, @kunwp1, @Yicong-Huang
    You can notify them by mentioning @bobbai00, @kunwp1, @Yicong-Huang in a comment.

@PG1204

PG1204 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @Yicong-Huang

@github-actions github-actions Bot requested a review from Yicong-Huang July 6, 2026 16:48
@codecov-commenter

codecov-commenter commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.49425% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.12%. Comparing base (db00f94) to head (ab701c8).

Files with missing lines Patch % Lines
...onent/workflow-editor/workflow-editor.component.ts 31.81% 27 Missing and 3 partials ⚠️
...c/app/workspace/component/menu/menu.component.html 22.22% 14 Missing ⚠️
...mponent/heatmap-legend/heatmap-legend.component.ts 44.44% 9 Missing and 1 partial ⚠️
...onent/heatmap-legend/heatmap-legend.component.html 28.57% 5 Missing ⚠️
...ent/workflow-editor/workflow-editor.component.html 42.85% 4 Missing ⚠️
...c/app/workspace/service/heatmap/heatmap-scoring.ts 91.83% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6213      +/-   ##
============================================
- Coverage     60.42%   60.12%   -0.30%     
+ Complexity     3353     3310      -43     
============================================
  Files          1133     1137       +4     
  Lines         43979    44146     +167     
  Branches       4781     4809      +28     
============================================
- Hits          26574    26544      -30     
- Misses        15945    16138     +193     
- Partials       1460     1464       +4     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from effa9c7
agent-service 44.59% <ø> (ø) Carriedforward from effa9c7
amber 65.15% <ø> (-0.72%) ⬇️ Carriedforward from effa9c7
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from effa9c7
config-service 52.30% <ø> (ø) Carriedforward from effa9c7
file-service 62.81% <ø> (-1.17%) ⬇️ Carriedforward from effa9c7
frontend 52.09% <61.49%> (+0.05%) ⬆️
notebook-migration-service 78.57% <ø> (ø) Carriedforward from effa9c7
pyamber 91.18% <ø> (ø) Carriedforward from effa9c7
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from effa9c7

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Yicong-Huang

Copy link
Copy Markdown
Contributor

Thanks @PG1204! I will take a look later on the code details.

@aglinxinyuan @xuang7 advises for UI (color, theme, etc)? any ideas to make it more good looking?

@aglinxinyuan

Copy link
Copy Markdown
Contributor

The current UI looks good to me. Can you provide a gif shows the workflow running in action and how does the other two options look like?

@PG1204

PG1204 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

The current UI looks good to me. Can you provide a gif shows the workflow running in action and how does the other two options look like?

Hi @aglinxinyuan, here's a screen recording gif of a running workflow with a look at all three options.
ScreenRecording2026-07-06at10 40 44PM-ezgif com-video-to-gif-converter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a toggleable performance heat-map overlay layer to the workflow canvas

4 participants