davsclaus opened a new pull request, #27544:
URL: https://github.com/apache/camel/pull/27544

   https://issues.apache.org/jira/browse/CAMEL-25438
   
   Tabs of the camel-jbang monitor that ask the selected integration for data 
(Threads, Beans, Startup, Type Converters, Diagram, JFR) stayed on "Loading…" 
for 2–5 s after selecting an integration, and longer when switching between 
them.
   
   **Measured** with 4 apps and 7 infra services, recording the actions the 
monitor writes:
   - an action takes ~1 s whatever its size: the CLI connector looks for one 
per 1 s loop;
   - the monitor sends one action at a time per integration;
   - selecting an integration sent 4 actions for tabs that were **not shown**: 
`jvm` 3 times (Classpath, CVE Audit and Maven Dependencies each loaded the 
classpath in `onIntegrationChanged`) and `route-structure` (Catalog);
   - the tab the user opened waited behind them. Beans asked for at 0.3 s was 
answered at 3.6 s; Startup asked for at 4.7 s at 8.6 s.
   
   **Fix:**
   - Classpath, CVE Audit, Maven Dependencies and Catalog no longer load in 
`onIntegrationChanged`; they load when shown, which `onTabSelected` already did.
   - `TabRegistry.resetIntegrationTabState` calls `onTabSelected` on the More 
tab on screen, so it still loads for the new integration.
   - `MonitorContext.jvmInfo(pid)` keeps the `jvm` answer per integration for 
30 s, shared by Classpath, CVE Audit (which asked twice per scan), Maven 
Dependencies and Heap Histogram.
   
   **After:** selecting an integration sends no action. Opening the tabs took 
0.9–2.2 s in a run with 2 apps; most of what is left is the connector's 1 s 
loop.
   
   **Tests:** `MonitorTabLazyLoadTest`. Hidden tabs send nothing on an 
integration change and load when shown; it fails without the fix. The `jvm` 
answer is shared per integration. To create a real `TuiRunner` there, the 
`NoopBackend` stand-in moved out of `TuiBackendHelperRecordingTest` into its 
own test class, and the new test is `@Isolated`, as the other tests with a 
runner are. All 1790 monitor tests pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to