← 输入框|github.com|刷新
Skip to content

[profiler] Display by default only "basic" metrics in the profiler - #7770

Merged
mihaibudiu merged 9 commits into
mainfrom
basic-metrics
Nov 6, 2026
Merged

mihaibudiu merged 9 commits into
mainfrom
basic-metrics

Conversation

@mihaibudiu

@mihaibudiu mihaibudiu commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

This PR has 8 different commits which make small improvements to the profiler.
Only some of them are visual. Others do some code cleanup and improve a very inefficient graph construction phase from quadratic to linear.

Here are some visual improvements:

Some UI elements now have pop-up titles on hover:

image

When the graph layout is recomputed the "computing layout" message appears much faster, it appears close to the mouse, and is much more visible; it used to appear in the minimap, where it could be ignored:

computing-layout

The biggest change however is to divide metrics display into 2 choices: basic/advanced. The basic metrics only show 4 essential metrics: time, memory, storage, input records. The drop-down also makes it much clearer which one is the currently selected metric (previously the behavior was rather strange). You can see them listed in the previous screenshot.

The display of the basic metrics looks as follows:

image

Describe Manual Test Plan

I have extracted the following screenshots from the improved profiler.

Checklist

  • Unit tests added/updated
  • Documentation updated

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

The next step is to use these features to implement #7296

Comment thread js-packages/profiler-lib/src/profile.ts Resolved
@mythical-fred-oss

Copy link
Copy Markdown
Contributor

What I ran

Check Result
profiler-lib: tsc --noEmit, vitest 328/330 pass. The 2 viewport.test.ts failures also happen on the base commit, so the PR didn't cause them
profiler-layout: svelte-check 0 errors
profiler-layout: test-unit 14/14 non-browser tests pass. I could not run the browser project here because Chromium is missing system libraries
pre-commit run --files <changed> Pass
Extra test: region with an edge that starts at a cluster (see inline comment) Fails: the region gets no output batch stats

Issues

  • bug (medium): The new boundary aggregation misses nested-circuit exports. Details and a repro are in the inline comment on profile.ts.
  • missing (medium), tests: These have no test:
    • Visualizer.rebuildGraph and afterNextPaint, including the dispose()-during-wait path and several quick expand/collapse toggles that each queue a rebuild.
    • The MetricsView "No basic metrics…" empty state.
    • The selected metric switching to runtime_seconds when you change level. Switching back to Standard does not restore the metric you had before; is that intended?
  • missing (medium), commit quality: Most commits have only a sign-off and no body. "Input/output records for a region should sum from input/output nodes" changes what users see for every region and needs a why. "Remove quadratic factor in Graph.addEdge" should give the complexity before and after. "Highligh" is a typo. Please squash the [ci] apply automatic fixes commit into the commit it fixes.
  • pitfall (low-medium): The tooltip (ProfilerTooltip.svelte) still uses the boolean showAdvanced. The Metrics tab now uses the 3-level control, so the two views filter differently.

@Karakatiza666

Copy link
Copy Markdown
Contributor

You should've consulted @AnnaZhand regarding adding the shadows to toggles. Anna can we do anything regarding the segment indicator appearance, or we should leave it alone until the redesign?

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

The shadows are a very small part of this PR, which is easy to change. But even I found these buttons puzzling, it's not obvious what you can do with them with the flat look, so I made them look more like buttons, to make it clear you can press them.

@Karakatiza666

Copy link
Copy Markdown
Contributor

No, I understand the intention; we just need to run that through Anna; I imagine this change is out-of-place. I am reviewing the rest in the meantime.

@Karakatiza666

Copy link
Copy Markdown
Contributor

"Basic | Standard | Advanced" looks too involved to me. If it were me I'd have either "Basic| All" or "Standard | Advanced", where the names don't necessarily correspond to what these groups include now. I would ask to reconsider if the user really need three choices. E.g. I would argue if we are doing this for the sake of making it simpler for the new users, "Basic | All" would be better: "Basic" for new users, "All" to not have experienced users guess whether the metric they are interested in will show up in "Standard" or not

@Anna-zh

Anna-zh commented Nov 1, 2026

Copy link
Copy Markdown

Let's don't add additional shadow to segmented control in this particular place. Lets bring it as a common concern and refresh style of segmented control across all UI

@Karakatiza666

Karakatiza666 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Given this Claude should completely cut out the new raised and segmentRaised variants of the segment indicator components. Anna will later do a visual change that applies to all uses of the indicator

@Karakatiza666 Karakatiza666 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the comments and discussed indicator shadow revert - LGTM

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

"Basic | Standard | Advanced" looks too involved to me.

For this let's see what @xiasongh thinks

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

I will push a new version which does the following:

Review comment Status
Remove the raised and segmentRaised variants (Karakatiza666, Anna-zh) Done: the 3D commit is dropped
Move the message next to the pointer into a common-ui component Done: PointerTooltip. It shows at once: next to the last pointer move or click, or in the middle of the window before either.
No frame counting in mountDiagram.ts Done. The paint wait stays; with the suggested queueMicrotask the test fails.
Lighter selection color in the metric selector Done: bg-primary-50-950, and bg-primary-100-900 under the pointer

@xiasongh

xiasongh commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

idk how useful a "basic" view is. the profiler is already an advanced tool and should cater towards the typical user of the profiler, so i lean towards showing more

if there's too much info, we could add a field filter/sort + save in local storage so people can decide for themselves what's useful to them?

@anandbraman

Copy link
Copy Markdown
Contributor

I am also in favor of having two categories: basic & advanced. If we do keep three categories, I'd propose adding some memory usage metrics to the basic view.

Long term, I hope that our goal is to have users spend less time investigating the profiles via the UI. These days, agents are commonly used to investigate support bundles, analyze bottlenecks, etc.

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

In this case I will amend the PR to remove the "advanced" bit from the Rust data structure, since it's not useful, and I will add something about memory to "basic"

@mihaibudiu
mihaibudiu force-pushed the basic-metrics branch 2 times, most recently from dc1aaff to ceef3be Compare November 5, 2026 03:59
@mihaibudiu
mihaibudiu added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 5, 2026
@mythical-fred-oss

Copy link
Copy Markdown
Contributor

Verdict: PR bug (high confidence) — a leftover e2e assertion, not a product bug.

Evidence

  • Failed job: Web Console Integration Tests, test tests/supportBundle.e2e.ts:68 › Profile viewer › remote profile download opens a working viewer (log lines 882–911).
  • assertNodeMetricsShowPersistentId (js-packages/web-console/tests/supportBundle.e2e.ts:255) waits for getByText(/persistent ID:/i) and times out.
  • This PR's b941d62c1 moved persistentId into the new advanced-only idAttributes list in MetricsView.svelte:23 (advanced: true), consistent with the unit test you added, "shows the persistent ID only above the basic level". The e2e test from issue [profiler-ui] UI does not display node parent id or node persistent id #6409 still checks for it in the viewer's default basic-only state (showAdvancedMetrics defaults to false), so it now times out instead of finding the row.

Fix on fred/observe-7770-41995612215 (commit 54cb64132): the e2e helper now clicks the "Show advanced" switch before asserting the persistent-ID row.

Take it with:

git fetch origin fred/observe-7770-41995612215
git cherry-pick 54cb64132

Compare: basic-metrics...fred/observe-7770-41995612215

Only this one e2e assertion needed updating; nothing else in the failed job pointed at a real regression.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
…tput nodes

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu
mihaibudiu added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit f4038bb Nov 6, 2026
1 check passed
@mihaibudiu
mihaibudiu deleted the basic-metrics branch November 6, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants