gnodet commented on code in PR #25491:
URL: https://github.com/apache/camel/pull/25491#discussion_r3781612744
##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java:
##########
@@ -1482,6 +1518,45 @@ private void renderStats(Frame frame, Rect area) {
}
}
+ private List<AiUsageEntry> combinedUsageEntries() {
+ List<AiUsageEntry> combined = new ArrayList<>(usageHistory.size() + 8);
+ combined.addAll(usageHistory);
+ List<SpanEntry> spans = otelSpans.get();
+ if (spans != null && !spans.isEmpty()) {
+ combined.addAll(GenAiSpanUsageExtractor.extract(spans));
+ }
+ return combined;
+ }
+
+ private static String modelTableKey(AiUsageEntry entry) {
+ String modelProvider = entry.model() + " (" + entry.provider() + ")";
+ if (entry.source() == AiUsageSource.ROUTE) {
+ String route = entry.routeId() != null &&
!entry.routeId().isBlank() ? entry.routeId() : "route";
+ return "[route:" + route + "] " + modelProvider;
+ }
+ return "[tui] " + modelProvider;
+ }
+
Review Comment:
Nit: `isStatsViewForTesting()` is called from production code in
`CamelMonitor.refreshConditionalData()` (line 2395), but the `ForTesting`
suffix implies it's a test-only accessor. Consider renaming to `isStatsView()`
— the codebase already uses the `ForTestingOrRuntime` suffix pattern for
dual-use methods (e.g. `setExitCallbackForTestingOrRuntime` at line 1508),
which suggests `ForTesting` should genuinely be test-only.
```suggestion
boolean isStatsView() {
return statsView;
}
```
##########
dsl/camel-jbang/camel-jbang-plugin-tui/pom.xml:
##########
@@ -41,6 +41,11 @@
</properties>
<dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-ai-observability-api</artifactId>
Review Comment:
Minor: This version element is unnecessary — `camel-ai-observability-api` is
managed in `camel-bom`, and all other Camel dependencies in this same file omit
the version. Removing it keeps the file consistent.
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]