davsclaus commented on code in PR #29381:
URL: https://github.com/apache/camel/pull/29381#discussion_r4501557924
##########
core/camel-console/src/main/java/org/apache/camel/impl/console/TimelineDevConsole.java:
##########
@@ -176,7 +187,51 @@ protected void doStop() throws Exception {
}
void sample() {
- recorder.sample(System.currentTimeMillis(), counters());
+ long now = System.currentTimeMillis();
+ recorder.sample(now, counters());
+ sampleChaos(now);
+ }
+
+ /**
+ * With camel-chaos, the faults per second of its rules and the routes
they have down, from its dev console (so this
+ * console does not depend on camel-chaos).
+ */
+ private void sampleChaos(long now) {
+ DevConsoleRegistry registry =
getCamelContext().getCamelContextExtension().getContextPlugin(DevConsoleRegistry.class);
+ DevConsole chaos = registry != null ? registry.resolveById("chaos") :
null;
+ if (chaos == null) {
+ return;
+ }
+ Object json;
+ try {
+ json = chaos.call(DevConsole.MediaType.JSON, Map.of("report",
"false"));
+ } catch (Exception e) {
+ return;
Review Comment:
Thanks, done in 143ff7f: a debug log with the exception (plain `LOG.debug`,
since slf4j checks the level itself).
_Claude Code on behalf of Claus Ibsen_
--
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]