feat(thread-dump): Enhancements for thread dump analyzer#389
feat(thread-dump): Enhancements for thread dump analyzer#389zachelnet wants to merge 14 commits into
Conversation
20be784 to
2e175d4
Compare
974d2fc to
20be784
Compare
20be784 to
c26b251
Compare
…pring Boot 3 Backend (analysis/thread-dump): - New diagnoser: ThreadDumpDiagnoser, Diagnostic, ThreadDumpAnalysisConfig - ThreadDumpAnalyzer: diagnose(), blockingThreads(), cpuConsumingThreads(), cpuConsumingThreadsCompare(), searchThreads(), threads() with state/id filter - Converter: robust locale-aware number parsing - New VOs: SearchHit, VBlockingThread, extended VThread - Tests: TestDiagnoser, TestConverter, TestAnalyzer updated Frontend (Vue 3): - New components: Diagnose, BlockedThreads (D3 tree), CpuConsumingThreads (ECharts bar), ThreadDumpSearch, ThreadDumpSearchForm, ThreadDumpOverview - ThreadDump.vue: thread summary with clickable colored el-tags per state - ThreadDumpOverview.vue: ECharts Doughnut + Bar charts with dark mode, resize handler and onUnmounted cleanup - STATE_COLORS covers all JavaThreadState + OSTreadState enum values - i18n: en.ts + zh.ts for all new keys Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
c26b251 to
f614d7a
Compare
|
@D-D-H, could you please review my port of |
Sure. Could you please rebase your branch on main? We bumped Spring Boot version to 4.1 this week, so it's a good idea to sync up and make sure everything still builds fine. |
There was a problem hiding this comment.
Pull request overview
Ports the Thread Dump Analyzer enhancements from the older Vue/Spring codebase into the current Vue 3 / Spring Boot 3 implementation, adding diagnostics, search, blocked-thread visualization, and CPU-focused analysis to improve thread-dump triage workflows.
Changes:
- Backend: adds
ThreadDumpDiagnoser+ThreadDumpAnalysisConfig, extends VOs (VThread) and introduces new VOs (Diagnostic,VBlockingThread,SearchHit), plus new analyzer endpoints (diagnose/search/blocking/CPU). - Backend: improves thread-dump time parsing to handle locale-specific number formats.
- Frontend: adds new Thread Dump UI components (diagnosis, blocked threads via D3, CPU charts via ECharts, full-text search, overview dashboard) and i18n keys, plus adds
d3dependency.
Reviewed changes
Copilot reviewed 23 out of 26 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| NOTICE | Adds contributor attribution for the thread-dump enhancements. |
| frontend/src/i18n/threaddump/zh.ts | Adds Chinese translations for new thread-dump UI/diagnostics/search/overview strings. |
| frontend/src/i18n/threaddump/en.ts | Adds English strings for new thread-dump UI/diagnostics/search/overview. |
| frontend/src/components/threaddump/ThreadDumpSearchForm.vue | New advanced search form (term, regex, case-sensitivity, field + state filters). |
| frontend/src/components/threaddump/ThreadDumpSearch.vue | New thread search results view with highlighted matches and state summary. |
| frontend/src/components/threaddump/ThreadDumpOverview.vue | New “dump overview” dashboard with state distribution, top CPU threads, and group summary charts. |
| frontend/src/components/threaddump/ThreadDump.vue | Integrates the new sections into the main Thread Dump page and adds state-based filtering. |
| frontend/src/components/threaddump/Thread.vue | Extends thread list querying to support filtering by threadState and explicit ids. |
| frontend/src/components/threaddump/Diagnose.vue | New diagnoser UI for displaying backend diagnostics and drilling into affected threads. |
| frontend/src/components/threaddump/CpuConsumingThreads.vue | New CPU chart view (ECharts) showing top CPU-consuming threads with drill-down. |
| frontend/src/components/threaddump/BlockedThreads.vue | New blocked-thread chain visualization (D3 tree) with drill-down. |
| frontend/package.json | Adds d3 dependency for blocked-thread visualization. |
| frontend/package-lock.json | Lockfile updates for d3 and transitive dependencies. |
| frontend/components.d.ts | Adds Element Plus ElCol / ElRow typing entries used by new layouts. |
| analysis/thread-dump/src/test/resources/jstack_17_with_blocked.log | New test fixture containing blocked threads + comma-decimal CPU/elapsed values. |
| analysis/thread-dump/src/test/java/org/eclipse/jifa/tda/TestDiagnoser.java | New tests covering blocked-thread detection, CPU parsing, and diagnoser behavior. |
| analysis/thread-dump/src/test/java/org/eclipse/jifa/tda/TestConverter.java | New tests for locale-aware numeric/time parsing (parseSecureDouble, str2TimeMillis). |
| analysis/thread-dump/src/test/java/org/eclipse/jifa/tda/TestAnalyzer.java | Updates tests for the extended threads() method signature. |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/vo/VThread.java | Extends VThread to include optional CPU/elapsed fields and constructors. |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/vo/VBlockingThread.java | New VO representing a blocking thread, its blocked threads, and the held monitor. |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/vo/SearchHit.java | New VO for search results including matched thread metadata and raw lines. |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/util/Converter.java | Enhances time parsing; adds locale-aware numeric parsing helper. |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/ThreadDumpAnalyzer.java | Adds diagnose/search/blocking/CPU endpoints and extends threads() filtering. |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/diagnoser/ThreadDumpDiagnoser.java | New diagnoser implementation (deadlock, blocked threads, high thread count, stack size, CPU ratio, exceptions). |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/diagnoser/ThreadDumpAnalysisConfig.java | New configuration object controlling diagnoser thresholds and toggles. |
| analysis/thread-dump/src/main/java/org/eclipse/jifa/tda/diagnoser/Diagnostic.java | New diagnostic result model (severity, type, params, affected threads). |
Files not reviewed (1)
- frontend/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Great work |
76954ef to
28264e6
Compare
- Replace non-functional el-icon-* CSS classes (Element UI v2) with proper <el-icon> components from @element-plus/icons-vue: CircleCloseFilled for ERROR, WarningFilled for WARNING, CircleCheckFilled for OK, InfoFilled for other severities - Move loading.value = false into .finally() so the spinner is always reset even when the diagnose request fails Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
Add onBeforeUpdate(() => { svgRefs.value = []; }) so that stale SVG
element references from removed list items are cleared before every
component update cycle – the Vue 3 recommended pattern for function
template refs used inside v-for.
Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
…ified name Add 'import java.text.ParsePosition' alongside the existing ParseException import and remove the java.text. prefix from both usages in parseSecureDouble. Keeps the import block consistent with the rest of the file. Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
…rman decimals NumberFormat.getInstance(Locale.US) treats comma as a thousands separator, so it parses "1,5" as 15.0 and "1,234" as 1234.0 – both wrong for JVM thread dumps produced in a German locale. Double.parseDouble() already handles all standard dot-decimal formats, so the Locale.US step is redundant and harmful. Fall back directly to Locale.GERMANY when Double.parseDouble fails. This was the original intent of the Copilot suggestion (use ParsePosition + full-string validation). Fixes 5 test failures in TestConverter: testParseSecureDouble_germanDecimalComma "1,5" expected 1.5 got 15.0 testParseSecureDouble_ambiguousSingleComma "1,234" expected 1.234 got 1234.0 testParseSecureDouble_whitespace " 1,5 " expected 1.5 got 15.0 testMilliseconds_germanComma "100,5ms" expected 100.5 got 1005.0 testSeconds_germanComma "1,5s" expected 1500 got 15000 Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
vue-i18n v9 does not support t(key, count, namedValues) — the third
argument is treated as options, not named values, so {blocker} was
never interpolated. Pass a single named-values object instead; vue-i18n
uses the 'count' field automatically for pluralization.
Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
The blocking thread name was rendered both in the <p> title above and as the root node label in the D3 SVG (with y=-40 + overflow:visible), causing the text to visually overlap the title row. Only render text labels for leaf nodes (blocked threads); the blocking thread is already prominently shown in the paragraph title. Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
Done! The branch is already rebased on main. All tests pass on the updated build. While I was at it, I also fixed a few smaller issues I noticed during testing: a {blocker} placeholder not rendering in the Blocked Threads title, a duplicate label in the SVG tree view, and a German locale parsing bug in Converter.java. |
D3 SVG text defaults to fill:black and links had hardcoded #ccc/eclipse-jifa#333 strokes — both invisible in dark mode. Read isDark at render time to set text fill and link stroke to appropriate light/dark values. Re-draw trees when the theme changes via watch(isDark). Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
|
@D-D-H Thanks for review👍. All fixes are in place. Whenever you have a chance, would be great to get this merged! |
Overview
This PR ports PR #231 by jutzig/SEEBURGER to the current Vue 3 / Spring Boot 3 codebase.
Changes
Backend (analysis/thread-dump)
ThreadDumpDiagnoserwith configurable thresholds (ThreadDumpAnalysisConfig) detects the following issues:diagnose()– runs all diagnostic checksblockingThreads()– returns blocking/blocked thread treescpuConsumingThreads()– top N threads by CPU timecpuConsumingThreadsCompare()– compare CPU usage across two snapshotssearchThreads()– full-text search with regex, field and state filtersthreads()extended withthreadStateandidsparameters1.234,56and1,234.56)SearchHit,VBlockingThread, extendedVThreadTestDiagnoser,TestConverter, updatedTestAnalyzerFrontend (Vue 3 / TypeScript)
Diagnose– displays diagnoser results with message, file and suggestion columnsBlockedThreads– D3.js tree diagram of blocking/blocked thread chainsCpuConsumingThreads– horizontal bar chart (ECharts) of top CPU threadsThreadDumpSearch+ThreadDumpSearchForm– full-text thread search with regex, field selection, state filter and results tableThreadDumpOverview– summary panel with state distribution (ECharts Doughnut), top CPU threads (ECharts Bar) and thread group summarywatch(isDark)resize()handler on window resizedispose()+removeEventListeneron unmountel-tagper state in Thread Summary and Thread Group Summary – clickable to filter threads by stateSTATE_COLORScovers all actual enum values fromJavaThreadStateandOSThreadState(PARKED_TIMED,PARKED,IN_OBJECT_WAIT,IN_OBJECT_WAIT_TIMED,SLEEPING,BLOCKED_ON_MONITOR_ENTER,COND_VAR_WAIT,OBJECT_WAIT,MONITOR_WAIT, etc.)AI Disclosure
This contribution was developed with AI assistance.
Assisted-by: GitHub Copilot (Claude Sonnet 4.5)