gnodet-bot commented on code in PR #29396:
URL: https://github.com/apache/camel/pull/29396#discussion_r4503990325


##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ChaosAiPrompt.java:
##########
@@ -189,8 +189,9 @@ private static void state(StringBuilder sb, IntegrationInfo 
info, ChaosInfo.Rule
             sb.append("It fired at 
").append(rule.firedAt.get("poll")).append(" polls of a consumer (no 
exchange).\n");
         }
         if (rule.expectRoute != null) {
-            sb.append("Expectation: 
").append(rule.expectRoute).append(':').append(rule.expectKind).append(rule.expectOp)
-                    .append(rule.expectCount).append(", 
").append(rule.expectOutcome != null ? rule.expectOutcome : "pending")
+            sb.append("Expectation: ").append(rule.expectSpec != null
+                    ? rule.expectSpec : rule.expectRoute + ":" + 
rule.expectKind + rule.expectOp + rule.expectCount)
+                    .append(", ").append(rule.expectOutcome != null ? 
rule.expectOutcome : "pending")
                     .append(" (").append(rule.expectValue).append(' 
').append(rule.expectKind).append(").\n");

Review Comment:
   ChaosTab.java and ListChaos.java were updated to format `meanTime`/`maxTime` 
values as human-readable durations (using `shortTime()`), but 
`ChaosAiPrompt.java` still outputs the raw millisecond long directly.
   
   The LLM prompt will show something like `(5000 meanTime)` where the other 
views show `(5s meanTime)`. Consider applying the same formatting here:
   
   ```suggestion
                       .append(" (").append("meanTime".equals(rule.expectKind) 
|| "maxTime".equals(rule.expectKind)
                               ? shortTime(rule.expectValue) : 
String.valueOf(rule.expectValue))
                               .append(' 
').append(rule.expectKind).append(").\n");
   ```
   
   Or using `TimeUtils.printDuration(rule.expectValue, true)` if `shortTime()` 
is not accessible from this class.



-- 
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]

Reply via email to