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
commit 04dac449b78444c8b91e0d7bee5c09dfc7aa5b12 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Oct 5 18:56:49 2023 +0200 CAMEL-15625: Add startup recorder dev console and be able to capture these. --- .../camel/catalog/main/camel-main-configuration-metadata.json | 2 +- .../org/apache/camel/startup/jfr/FlightRecorderStartupStep.java | 6 ++++++ docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_1.adoc | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json index 237e996e769..de05f6d7933 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json @@ -109,7 +109,7 @@ { "name": "camel.main.shutdownSuppressLoggingOnTimeout", "description": "Whether Camel should try to suppress logging during shutdown and timeout was triggered, meaning forced shutdown is happening. And during forced shutdown we want to avoid logging errors\/warnings et all in the logs as a side-effect of the forced timeout. Notice the suppress is a best effort as there may still be some logs coming from 3rd party libraries and whatnot, which Camel cannot control. This option is defa [...] { "name": "camel.main.shutdownTimeout", "description": "Timeout in seconds to graceful shutdown all the Camel routes.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 45 }, { "name": "camel.main.sourceLocationEnabled", "description": "Whether to capture precise source location:line-number for all EIPs in Camel routes. Enabling this will impact parsing Java based routes (also Groovy, Kotlin, etc.) on startup as this uses JDK StackTraceElement to calculate the location from the Camel route, which comes with a performance cost. This only impact startup, not the performance of the routes at runtime.", "sourceType": "org.apache.camel.main.DefaultConfiguratio [...] - { "name": "camel.main.startupRecorder", "description": "To use startup recorder for capturing execution time during starting Camel. The recorder can be one of: false (or off), logging, java-flight-recorder (or jfr).", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "enum": [ "false", "off", "java-flight-recorder", "jfr", "logging" ] }, + { "name": "camel.main.startupRecorder", "description": "To use startup recorder for capturing execution time during starting Camel. The recorder can be one of: false (or off), logging, backlog, java-flight-recorder (or jfr).", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "enum": [ "false", "off", "java-flight-recorder", "jfr", "logging", "backlog" ] }, { "name": "camel.main.startupRecorderDir", "description": "Directory to store the recording. By default the current directory will be used. Use false to turn off saving recording to disk.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.main.startupRecorderDuration", "description": "How long time to run the startup recorder. Use 0 (default) to keep the recorder running until the JVM is exited. Use -1 to stop the recorder right after Camel has been started (to only focus on potential Camel startup performance bottlenecks) Use a positive value to keep recording for N seconds. When the recorder is stopped then the recording is auto saved to disk (note: save to disk can be disabled by setting startupRec [...] { "name": "camel.main.startupRecorderMaxDepth", "description": "To filter our sub steps at a maximum depth. Use -1 for no maximum. Use 0 for no sub steps. Use 1 for max 1 sub step, and so forth. The default is -1.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": -1 }, diff --git a/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStep.java b/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStep.java index 9a0c2f1bfc1..74f2409ba78 100644 --- a/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStep.java +++ b/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStep.java @@ -82,6 +82,12 @@ public class FlightRecorderStartupStep extends Event implements StartupStep { return 0; } + @Override + public long getDuration() { + // not used by jfr + return 0; + } + @Override public String getType() { return type; diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_1.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_1.adoc index 497462e8e77..7ec4b675246 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_1.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_1.adoc @@ -14,6 +14,8 @@ to `org.apache.camel.spi.Injector`. Added `isIgnoreLoadingError` and `setIgnoreLoadingError` methods to `org.apache.camel.spi.RoutesLoader`, and `org.apache.camel.main.RoutesCollector`. +Added `getDuration` method to `org.apache.camel.StartupStep`. + === XML and YAML DSL ==== Creating beans from script