This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 12617311ee4c CAMEL-24003: Reset stats clears activity, traces and
errors in TUI and running app
12617311ee4c is described below
commit 12617311ee4cddfef407a2168f8570cca6781641
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jul 13 15:13:39 2026 +0200
CAMEL-24003: Reset stats clears activity, traces and errors in TUI and
running app
Also fix Stop All popup position and improve labels to show running count.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../java/org/apache/camel/cli/connector/LocalCliConnector.java | 8 ++++++++
.../apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java | 6 ++++++
.../apache/camel/dsl/jbang/core/commands/tui/StopAllPopup.java | 8 ++++----
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git
a/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java
b/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java
index 4e8123d0d767..eee6b7a0c13d 100644
---
a/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java
+++
b/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java
@@ -67,6 +67,7 @@ import org.apache.camel.model.ProcessorDefinitionHelper;
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.model.language.ExpressionDefinition;
import org.apache.camel.spi.BacklogDebugger;
+import org.apache.camel.spi.BacklogTracer;
import org.apache.camel.spi.CliConnector;
import org.apache.camel.spi.CliConnectorFactory;
import org.apache.camel.spi.ContextReloadStrategy;
@@ -1023,6 +1024,13 @@ public class LocalCliConnector extends ServiceSupport
implements CliConnector, C
if (reg != null) {
reg.reset();
}
+ BacklogTracer tracer =
camelContext.getCamelContextExtension().getContextPlugin(BacklogTracer.class);
+ if (tracer != null) {
+ tracer.clear();
+ }
+ if (camelContext.getErrorRegistry() != null) {
+ camelContext.getErrorRegistry().clear();
+ }
}
private void doActionDebugTask(JsonObject root) throws Exception {
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 fe49c4bcfd84..2de53f6ac5cf 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
@@ -1839,6 +1839,12 @@ public class CamelMonitor extends CamelCommand {
Path actionFile = ctx.getActionFile(pid);
PathUtils.writeTextSafely(root.toJson(), actionFile);
dataService.metrics().resetStats(pid);
+
+ info.activity = List.of();
+ info.errors = new ArrayList<>();
+ dataService.traces().set(Collections.emptyList());
+ dataService.traceFilePositions().clear();
+ tabRegistry.historyTab().historyEntries = Collections.emptyList();
}
private void playBuiltinAnimation(String name) {
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StopAllPopup.java
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StopAllPopup.java
index 6379b7b3f66f..d9c36ad50dea 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StopAllPopup.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/StopAllPopup.java
@@ -137,16 +137,16 @@ class StopAllPopup {
}
void render(Frame frame, Rect area) {
- int popupW = Math.min(42, area.width() - 4);
+ int popupW = Math.min(48, area.width() - 4);
int popupH = 6;
int x = area.left() + Math.max(0, (area.width() - popupW) / 2);
- int y = area.top() + Math.max(0, (area.height() - popupH) / 2);
+ int y = area.top() + 2;
Rect popup = new Rect(x, y, Math.min(popupW, area.width()),
Math.min(popupH, area.height()));
frame.renderWidget(Clear.INSTANCE, popup);
- String intLabel = (checkIntegrations ? "[x]" : "[ ]") + " All
integrations (" + integrationCount + ")";
- String infraLabel = (checkInfra ? "[x]" : "[ ]") + " All infra
services (" + infraCount + ")";
+ String intLabel = (checkIntegrations ? "[x]" : "[ ]") + " All
integrations (" + integrationCount + " running)";
+ String infraLabel = (checkInfra ? "[x]" : "[ ]") + " All infra
services (" + infraCount + " running)";
Style normalStyle = Style.EMPTY;
Style selectedStyle = Style.EMPTY.bold().reversed();