This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit f8eff8f362e2d826a21c85060abeae648cd10516 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Mar 17 12:05:12 2021 +0100 CAMEL-16201: camel-jfr - Save camel-recording in current dir by default --- .../apache/camel/startup/jfr/FlightRecorderStartupStepRecorder.java | 2 +- .../src/main/java/org/apache/camel/spi/StartupStepRecorder.java | 2 +- .../resources/META-INF/camel-main-configuration-metadata.json | 2 +- core/camel-main/src/main/docs/main.adoc | 2 +- .../java/org/apache/camel/main/DefaultConfigurationProperties.java | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStepRecorder.java b/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStepRecorder.java index f3a4e96..bb21a36 100644 --- a/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStepRecorder.java +++ b/components/camel-jfr/src/main/java/org/apache/camel/startup/jfr/FlightRecorderStartupStepRecorder.java @@ -62,7 +62,7 @@ public class FlightRecorderStartupStepRecorder extends DefaultStartupStepRecorde if (!"false".equals(getRecordingDir())) { // recording to disk can be turned off by setting to false - Path dir = getRecordingDir() != null ? Paths.get(getRecordingDir()) : Paths.get(System.getenv().get("HOME")); + Path dir = getRecordingDir() != null ? Paths.get(getRecordingDir()) : Paths.get("."); Path file = Files.createTempFile(dir, "camel-recording", ".jfr"); // when stopping then the recording is automatic dumped by flight recorder rec.setDestination(file); diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/StartupStepRecorder.java b/core/camel-api/src/main/java/org/apache/camel/spi/StartupStepRecorder.java index be3f68a..634dd14 100644 --- a/core/camel-api/src/main/java/org/apache/camel/spi/StartupStepRecorder.java +++ b/core/camel-api/src/main/java/org/apache/camel/spi/StartupStepRecorder.java @@ -59,7 +59,7 @@ public interface StartupStepRecorder extends StaticService { String getRecordingDir(); /** - * Directory to store the recording. By default the user home directory will be used. + * Directory to store the recording. By default the current directory will be used. */ void setRecordingDir(String recordingDir); diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json index 37ad57d..3b4bd8f 100644 --- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json +++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json @@ -78,7 +78,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 Camel.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 45 }, { "name": "camel.main.startupRecorder", "description": "To use startup recorder for capturing execution time during starting Camel. The recorder can be one of: false, logging, java-flight-recorder The default is false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, - { "name": "camel.main.startupRecorderDir", "description": "Directory to store the recording. By default the user home 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.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 }, { "name": "camel.main.startupRecorderProfile", "description": "To use a specific Java Flight Recorder profile configuration, such as default or profile. The default is default.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "default" }, diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc index 8a36592..0520f40 100644 --- a/core/camel-main/src/main/docs/main.adoc +++ b/core/camel-main/src/main/docs/main.adoc @@ -90,7 +90,7 @@ The following table lists all the options: | *camel.main.shutdownSuppress{zwsp}LoggingOnTimeout* | 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 default false. | | boolean | *camel.main.shutdownTimeout* | Timeout in seconds to graceful shutdown Camel. | 45 | int | *camel.main.startupRecorder* | To use startup recorder for capturing execution time during starting Camel. The recorder can be one of: false, logging, java-flight-recorder The default is false. | | String -| *camel.main.startupRecorderDir* | Directory to store the recording. By default the user home directory will be used. Use false to turn off saving recording to disk. | | String +| *camel.main.startupRecorderDir* | Directory to store the recording. By default the current directory will be used. Use false to turn off saving recording to disk. | | String | *camel.main.startupRecorder{zwsp}Duration* | 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 startupRecorderDir to false) | | long | *camel.main.startupRecorderMax{zwsp}Depth* | 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. | -1 | int | *camel.main.startupRecorder{zwsp}Profile* | To use a specific Java Flight Recorder profile configuration, such as default or profile. The default is default. | default | String diff --git a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java index 0a87c51..dfff669 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java @@ -1221,7 +1221,7 @@ public abstract class DefaultConfigurationProperties<T> { } /** - * Directory to store the recording. By default the user home directory will be used. Use false to turn off saving + * Directory to store the recording. By default the current directory will be used. Use false to turn off saving * recording to disk. */ public void setStartupRecorderDir(String startupRecorderDir) { @@ -2044,7 +2044,7 @@ public abstract class DefaultConfigurationProperties<T> { } /** - * Directory to store the recording. By default the user home directory will be used. + * Directory to store the recording. By default the current directory will be used. */ public T withStartupRecorderDir(String startupRecorderDir) { this.startupRecorderDir = startupRecorderDir;