feat(thread-dump): Enhancements for thread dump analyzer - #389
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)
- Add spring-boot-starter-oauth2-client dependency - Configure OIDC provider (Keycloak) via application.yml env vars: OIDC_ISSUER_URI, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET - UserServiceImpl: extract name from OIDC claims with fallback to preferred_username and principalName (prevents NPE) - allow-login / allow-anonymous-access / allow-registration configurable via environment variables - All three Keycloak vars must be set together; commented template in application.yml and docker-compose.yml 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
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. |
|
@D-D-H Thanks for review👍. All fixes are in place. Whenever you have a chance, would be great to get this merged! |
|
Thank you for the feedback on rebasing. The branch is now synced with main and all tests pass with Spring Boot 4.1. During testing, I also fixed several issues:
The PR is ready for review whenever you have time. If a detailed walk-through of any section would be helpful, or if you'd prefer to review this in smaller chunks, I'm happy to accommodate. Thank you! 🙏 |
y1yang0
left a comment
There was a problem hiding this comment.
Some of my suggestions and observations
- UI components are not center-aligned.
- The font size and style are inconsistent. Additionally, it is expected that the red dot, like the blue dot, should have a label to clearly indicate to the user which one is ReferenceHandler and which one is Finalizer.
- Ditto. The font size and style are inconsistent
-
The Java Thread State Distribution pie chart could perhaps be part of Basic Information, rather than being displayed at a later position on the page.
-
The duplicated "Top CPU Consuming Threads" tables could be merged into a single collapsible panel, with a clear distinction between NonJavaThread and JavaThread.
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)
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)
…iagnosis (Basic Information) Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
…variables Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
…ble regex Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
…r clarity Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
372527f to
45c7014
Compare
…RS to shared module - Move window resize listener for state chart into onMounted/onUnmounted to prevent handler accumulation on repeated mount/unmount cycles - Set stateChart = null after dispose() to release the reference - Extract STATE_COLORS and stateColor() into thread-state-colors.ts so ThreadDump.vue and ThreadDumpSearch.vue share a single source of truth Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
Backend (ThreadDumpAnalyzer): - remove cpuConsumingThreadsCompare API whose parameter cannot be marshalled through the analysis API layer and which has no consumer - cpuConsumingThreads: exclude threads without cpu data (cpu <= 0) - searchThreads: apply name/state filters before any file I/O and read matched thread contents in a single sequential pass; propagate IOException instead of swallowing it Frontend: - ThreadDump: drop the state distribution pie chart; build the Total row state tags by merging per-type distributions (Java states for Java threads, OS states otherwise) so counts and tag clicks are consistent with backend thread filtering - thread-state-colors: soft tinted tag style (light background, colored text/border) with a semantic, less saturated palette; works in light and dark themes - ThreadDumpSearch: render results in a table (expandable stack rows, sortable CPU/elapsed columns) with an inline summary bar; stack content style matches Thread.vue - ThreadDumpSearchForm: remove card wrapper, inline search input with appended button and 'More Options' toggle, left-aligned layout, aligned labels and section titles - CpuConsumingThreads: query JIT/GC/VM types separately for the non-Java chart; center x-axis name to avoid clipped label - Diagnose: shared table header style and icon/message alignment - i18n: rename search section to 'Find Threads', clearer placeholder, rename keys (matchFields/matchFieldXxx/otherOptions) Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
|
I've made some changes based on your branch with the help of GitHub Copilot. Please take a look and see if they look good to you! |
|
There are still a few areas for improvement. I plan to address them and then merge this PR. |
|
Hi @D-D-H, I noticed that the cpuConsumingThreadsCompare API part was removed. If it makes sense for you, we could also implement it in a separate PR. |
Okay. Let's handle it in a separate PR. |

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)