Skip to content

TUI: add Circuit Breaker tab and throughput ok/fail chart#23261

Merged
davsclaus merged 11 commits into
mainfrom
fix/camel-tui-circuit-breaker
May 16, 2026
Merged

TUI: add Circuit Breaker tab and throughput ok/fail chart#23261
davsclaus merged 11 commits into
mainfrom
fix/camel-tui-circuit-breaker

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

Claude Code on behalf of Claus Ibsen

  • Circuit Breaker tab (tab 5): new dedicated tab showing Resilience4j / MicroProfile Fault Tolerance / generic circuit breaker state. Columns: ROUTE, ID, COMPONENT, STATE (coloured green/yellow/red), PENDING, SUCCESS, FAIL, RATE%, REJECT. Supports ↑↓ navigation and shows (N OPEN) red badge on the tab label when any breaker is open.
  • Throughput chart overhaul: the overview page bar chart now renders split green/red bars (ok vs failed), with:
    • Y-axis scale labels (max, max/2, 0) aligned to chart rows
    • X-axis time markers (-Ns and now) below the chart
    • Styled title legend showing current msg/s, ok, and fail counts
    • Dynamic tick count that fills available terminal width (up to 60 s of history)

Test plan

  • Start a Camel integration with circuit breakers configured (e.g. Resilience4j)
  • Open camel tui; verify tab 5 appears as "Circuit Breaker" (or "Circuit Breaker (1 OPEN)" when tripped)
  • Verify ↑↓ navigate rows in the circuit breaker table
  • Verify throughput chart on overview shows green/red split bars
  • Verify Y-axis labels and X-axis time markers render without overlap

🤖 Generated with Claude Code

davsclaus and others added 6 commits May 16, 2026 16:16
New tab showing all circuit breakers for the selected integration,
inserted between Endpoints and Health. Supports all three Camel
implementations: resilience4j, fault-tolerance, and core
(ThrottlingExceptionRoutePolicy).

Columns: ROUTE · ID · COMPONENT · STATE · PENDING · SUCCESS · FAIL · RATE% · REJECT
- STATE is colour-coded: green=CLOSED, red=OPEN/FORCED_OPEN, yellow=HALF_OPEN
- PENDING and REJECT are resilience4j-only
- RATE% is resilience4j-only (failure rate percentage)
- fault-tolerance shows only ROUTE · ID · STATE (its dev console provides no counters)

Sort: press 's' to cycle ROUTE → ID → COMPONENT → STATE.
Tab badge shows circuit breaker count; empty table shows "No circuit breakers".

Tab numbering shifted: Circuit Breaker=5, Health=6, History=7, Trace=8.
All footer hints updated to "1-8 tabs". Health tab gains red "(N DOWN)" badge
when any check is DOWN.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s are open

When one or more circuit breakers are OPEN or FORCED_OPEN, the tab title
changes to a red '(N OPEN)' badge — same pattern as the Health tab's
'(N DOWN)' indicator.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Track failed/s alongside total/s in the sparkline history. Each time
slot in the overview chart now renders as two bars side-by-side:
- green bar = ok exchanges per second (total - failed)
- red bar = failed exchanges per second

30 time slots × 2 bars × width=1 = ~60 columns, preserving the same
visual footprint as the previous single-bar chart. Chart title shows
current throughput broken down as 'N ok / M failed'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Setting textValue("") hides the 0/value labels below each bar.
The current numbers are already shown in the chart title.

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

barWidth=1 only fits single digits; with barWidth=2 values 0-99 render
inside the bar. Render points reduced from 30 to 20 to keep total chart
width roughly constant (20 × 2 bars × width 2 = ~80 columns).

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

- Replace single-color sparkline with BarGroup (green=ok, red=failed) bars
- Dynamic tick count: fills available terminal width (up to 60s of history)
- Y-axis scale labels (max, max/2, 0) aligned with bar chart rows
- X-axis time markers (-Ns labels and "now") drawn below the chart
- Styled title legend showing current msg/s, ok count and fail count
- barWidth=1, textValue("") suppresses per-bar numeric labels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davsclaus davsclaus force-pushed the fix/camel-tui-circuit-breaker branch from 3170c1c to 7217938 Compare May 16, 2026 14:17
@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 16, 2026
The route dev console JSON already includes a "group" field on each
route when a route group is set. Parse it into RouteInfo and display
it as a dimmed GROUP column between ROUTE and FROM. The column is
sortable via the 's' key, cycling in column order: name → group → status → total → failed.
COVER value is right-aligned.

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

github-actions Bot commented May 16, 2026

🧪 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 and others added 4 commits May 16, 2026 16:34
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Camel returns -1 for mean/min/max processing time when no exchanges have
completed yet. Clamp to 0 at parse time so the MIN/MAX/MEAN column never
displays -1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces Color.RED with Color.LIGHT_RED (ANSI bright red) throughout the
TUI so that failure states, DOWN health checks, OPEN circuit breakers,
failed exchange counts, and error text all render with the same light red
that is visible on dark/black terminal backgrounds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The light red (BRIGHT_RED) does not contrast well against the bar chart
background. Revert the chart bars and legend swatch back to the darker
Color.RED while keeping Color.LIGHT_RED for text-based error indicators.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davsclaus davsclaus merged commit 9f8ccfa into main May 16, 2026
6 checks passed
@davsclaus davsclaus deleted the fix/camel-tui-circuit-breaker branch May 16, 2026 15:29
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.

2 participants