This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch fix/camel-tui-circuit-breaker
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/fix/camel-tui-circuit-breaker
by this push:
new 24b33e0cec7c TUI: widen throughput bars to 2 cols so double-digit
values display correctly
24b33e0cec7c is described below
commit 24b33e0cec7c8691befb5d4c471b09538f249fa0
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat May 16 15:51:03 2026 +0200
TUI: widen throughput bars to 2 cols so double-digit values display
correctly
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 <[email protected]>
---
.../camel/dsl/jbang/core/commands/tui/CamelMonitor.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
index 3ead3679ea0b..213c4bc6071d 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
@@ -978,8 +978,9 @@ public class CamelMonitor extends CamelCommand {
// Split green/red throughput bar chart
if (hasSparkline && chunks.size() > 1) {
- // Render last 30 ticks as pairs of bars (ok=green, failed=red) to
keep ~60 columns
- int renderPoints = Math.min(30, MAX_SPARKLINE_POINTS);
+ // Render last 20 ticks as pairs of bars (ok=green, failed=red);
barWidth=2 so
+ // double-digit values fit: 20 ticks × 2 bars × width 2 = ~80
columns
+ int renderPoints = Math.min(20, MAX_SPARKLINE_POINTS);
long[] mergedTotal = new long[renderPoints];
long[] mergedFailed = new long[renderPoints];
for (int i = 0; i < renderPoints; i++) {
@@ -1011,14 +1012,14 @@ public class CamelMonitor extends CamelCommand {
long failed = Math.min(mergedFailed[i], mergedTotal[i]);
long ok = Math.max(0, mergedTotal[i] - failed);
groups.add(BarGroup.of(
-
Bar.builder().value(ok).textValue("").style(Style.EMPTY.fg(Color.GREEN)).build(),
-
Bar.builder().value(failed).textValue("").style(Style.EMPTY.fg(Color.RED)).build()));
+
Bar.builder().value(ok).style(Style.EMPTY.fg(Color.GREEN)).build(),
+
Bar.builder().value(failed).style(Style.EMPTY.fg(Color.RED)).build()));
}
BarChart barChart = BarChart.builder()
.data(groups)
.max(maxTp > 0 ? maxTp + 2 : 2)
- .barWidth(1)
+ .barWidth(2)
.barGap(0)
.groupGap(0)
.block(Block.builder().borderType(BorderType.ROUNDED).title(chartTitle).build())