Skip to content

TUI: load averages, UX improvements, lazy loading, navigation fixes#23269

Merged
davsclaus merged 6 commits into
mainfrom
fix/camel-tui-load-avg
May 17, 2026
Merged

TUI: load averages, UX improvements, lazy loading, navigation fixes#23269
davsclaus merged 6 commits into
mainfrom
fix/camel-tui-load-avg

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • Add CPU (EWMA via ProcessHandle.totalCpuDuration()) and inflight load averages (1m/5m/15m) to the overview info panel; inflight EWMA is read from the existing load01/load05/load15 JSON fields already produced by ManagedCamelContext, making it remote-ready
  • Fix overview selection bug: cursor up/down now resolves row index against the same sorted list used for rendering, so selection tracks the correct PID after sorting
  • Lazy-load optimisation: log lines and trace data are only fetched when their respective tabs are active, reducing disk I/O on every tick
  • Move Circuit Breaker tab to last position (tab 9)
  • Remove (*) indicator from Log tab header
  • Add a = chart [all|single|off] toggle on overview tab and a = chart [all|off] toggle on endpoints tab; increase endpoint flow panel height from 12 → 16 rows
  • Disable cursor navigation (no highlight, no key handling) for Consumers, Endpoints and Health tabs — no detail action exists yet for these
  • Remove ↑↓ navigate hint from footer on Consumers, Endpoints and Health tabs
  • Move Esc unselect hint immediately after q quit in overview footer

Claude Code on behalf of Claus Ibsen

Test plan

  • Run camel-jbang TUI against a local Camel integration and verify overview info panel shows CPU and inflight load averages
  • Verify cursor up/down on overview tab correctly tracks the selected integration after sort changes
  • Verify log and trace tabs only load data when active (no unnecessary disk reads)
  • Verify Circuit Breaker is tab 9
  • Verify Consumers, Endpoints and Health tables have no row highlight and no navigate key hint in the footer
  • Verify a key cycles chart modes on overview and endpoints tabs

davsclaus and others added 6 commits May 17, 2026 19:34
Displays 1m/5m/15m exponentially weighted moving averages for both
process CPU% (sampled via ProcessHandle.totalCpuDuration delta) and
inflight exchange concurrency in the overview info panel, mirroring
the Unix uptime load average convention used by Camel's own LoadTriplet.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… from JSON

- Extract sortedOverviewInfos() so renderOverview, syncSelectedPidFromOverview,
  selectCurrentIntegration, and navigateDown all use the same sorted order;
  previously UP/DOWN keys resolved row index against an unsorted list while
  the table rendered a sorted one, causing the wrong integration to be selected
- Read inflight load01/05/15 directly from the management JSON (already computed
  by ManagedCamelContext.LoadTriplet and serialized by ContextDevConsole) instead
  of maintaining a redundant local EWMA; works correctly for remote processes too

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Gate log file tailing on Log tab being active; reset file position on
  tab switch so the next tick picks up correctly — avoids disk reads on
  every tick when on other tabs (was the only reason for the (*) indicator
  which has now been removed from the Log tab header)
- Gate trace file reads on Trace tab being active; tab-switch handler
  already does an explicit load so tick-level reads were redundant
- Remove eager refreshHistoryData/refreshTraceData from selection-change
  handlers; handleTabKey already loads on demand when switching to those tabs
- Move Circuit Breaker to tab 9 (last); shift Health→6, Last→7, Trace→8

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tabs 4, 5, 6 have no detail action yet. Remove highlightStyle and
highlightSpacing(ALWAYS) from the table builders so no selection
highlight appears, and drop the navigateUp/navigateDown cases for
these tabs so cursor keys are inert on them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h tabs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-plugin-tui
All tested modules (2 modules)
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: Launcher :: Container

⚙️ View full build and test results

@davsclaus davsclaus merged commit 4119d9c into main May 17, 2026
6 checks passed
@davsclaus davsclaus deleted the fix/camel-tui-load-avg branch May 17, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant