Fix flame chart tree building, layout, and add metric selection#312
Merged
butschster merged 3 commits intomasterfrom Mar 26, 2026
Merged
Fix flame chart tree building, layout, and add metric selection#312butschster merged 3 commits intomasterfrom
butschster merged 3 commits intomasterfrom
Conversation
PrepareEdges — rewrite parent resolution with two-pass approach: - First pass creates all edges and builds a complete callee→edgeId map - Second pass resolves parent references using the full map, eliminating the incorrect $prev fallback that linked edges to wrong parents when the caller function hadn't yet been processed - BFS ordering ensures parents always precede children in edge order, which is required for correct tree construction in the flame chart - Add ct to percentage calculation (p_ct was always 0) FindFlameChartByUuidHandler — fix layout and metric handling: - adjustStartTimes now clamps children within parent bounds: if the sum of children durations exceeds the parent, they are scaled down proportionally instead of overflowing the parent block - Use metric-appropriate divisor (μs→ms for time, bytes→KB for memory) - Parameterize metric via query (was hardcoded to wt) - Include metric in cache file key to avoid stale cache across metrics Add FlameChartRequest filter and wire metric through controller → query. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
PreparePeaks now normalizes all profile entries by filling missing metrics with 0 defaults before any downstream handler accesses them. This fixes the ErrorException on CalculateDiffsBetweenEdges when cpu key is absent, which happens in environments (e.g. DDEV) that disable CPU profiling for performance. Co-Authored-By: Claude Opus 4.6 (1M context) <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
callee→edgeIdmap, then resolves parent references. Eliminates the$prevfallback that linked edges to wrong parents when the caller hadn't been processed yet. BFS ordering ensures parents always precede children.wt(wall time). Now accepts metric from frontend (wt,cpu,mu,pmu) with metric-appropriate divisor (μs→ms for time, bytes→KB for memory). Metric is included in cache key.ctto percentage calculation inPrepareEdges(p_ctwas always 0).Test plan
🤖 Generated with Claude Code