This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch feature/CAMEL-23870-heap-histogram in repository https://gitbox.apache.org/repos/asf/camel.git
commit 8a4275992e9ef2cd2dc5ed4283de5b4cf9952d1a Author: Claus Ibsen <[email protected]> AuthorDate: Wed Jul 1 16:25:06 2026 +0200 chore: move heap histogram summary into table title Co-Authored-By: Claude <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../jbang/core/commands/tui/HeapHistogramTab.java | 39 ++++++++-------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HeapHistogramTab.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HeapHistogramTab.java index 78e97418d3f2..13ef05e0b230 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HeapHistogramTab.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/HeapHistogramTab.java @@ -167,31 +167,10 @@ class HeapHistogramTab implements MonitorTab { List<HeapEntry> visible = sortedEntries(); List<Rect> chunks = Layout.vertical() - .constraints(Constraint.length(1), Constraint.percentage(60), Constraint.fill()) + .constraints(Constraint.percentage(60), Constraint.fill()) .split(area); - renderSummary(frame, chunks.get(0), visible); - renderTable(frame, chunks.get(1), visible); - renderDetail(frame, chunks.get(2), visible); - } - - private void renderSummary(Frame frame, Rect area, List<HeapEntry> visible) { - long visibleInstances = 0; - long visibleBytes = 0; - for (HeapEntry e : visible) { - visibleInstances += e.instances; - visibleBytes += e.bytes; - } - - List<Span> spans = new ArrayList<>(); - spans.add(Span.styled(" Classes: ", Style.EMPTY.fg(Color.YELLOW).bold())); - spans.add(Span.styled(String.valueOf(visible.size()), Style.EMPTY.fg(Color.WHITE))); - spans.add(Span.raw(" ")); - spans.add(Span.styled("Instances: ", Style.EMPTY.fg(Color.YELLOW).bold())); - spans.add(Span.styled(formatNumber(visibleInstances), Style.EMPTY.fg(Color.WHITE))); - spans.add(Span.raw(" ")); - spans.add(Span.styled("Bytes: ", Style.EMPTY.fg(Color.YELLOW).bold())); - spans.add(Span.styled(formatBytes(visibleBytes), Style.EMPTY.fg(Color.WHITE))); - frame.renderWidget(Paragraph.from(Line.from(spans)), area); + renderTable(frame, chunks.get(0), visible); + renderDetail(frame, chunks.get(1), visible); } private void renderTable(Frame frame, Rect area, List<HeapEntry> visible) { @@ -210,8 +189,16 @@ class HeapHistogramTab implements MonitorTab { Cell.from(""), Cell.from(""), Cell.from(""))); } - String title = String.format(" Heap Histogram [%d] sort:%s filter:%s ", - visible.size(), sort, FILTER_LABELS[filter]); + long visibleInstances = 0; + long visibleBytes = 0; + for (HeapEntry e : visible) { + visibleInstances += e.instances; + visibleBytes += e.bytes; + } + + String title = String.format(" Heap Histogram [%d] instances:%s bytes:%s sort:%s filter:%s ", + visible.size(), formatNumber(visibleInstances), formatBytes(visibleBytes), + sort, FILTER_LABELS[filter]); Table table = Table.builder() .rows(rows)
