This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 0bfba66 camel-jfr - Polish the options in main
0bfba66 is described below
commit 0bfba66087c00862ef133693eb32d90e5dedbb94
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Mar 18 09:07:08 2021 +0100
camel-jfr - Polish the options in main
---
.../resources/META-INF/camel-main-configuration-metadata.json | 2 +-
core/camel-main/src/main/docs/main.adoc | 2 +-
.../src/main/java/org/apache/camel/main/BaseMainSupport.java | 6 ++++--
.../org/apache/camel/main/DefaultConfigurationProperties.java | 11 +++++------
4 files changed, 11 insertions(+), 10 deletions(-)
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 3b4bd8f..b6089dc 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
@@ -77,7 +77,7 @@
{ "name": "camel.main.shutdownRoutesInReverseOrder", "description": "Sets
whether routes should be shutdown in reverse or the same order as they were
started.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean",
"javaType": "boolean", "defaultValue": true },
{ "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.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.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/core/camel-main/src/main/docs/main.adoc
b/core/camel-main/src/main/docs/main.adoc
index 0520f40..65547e6 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -89,7 +89,7 @@ The following table lists all the options:
| *camel.main.shutdownRoutesIn{zwsp}ReverseOrder* | Sets whether routes should
be shutdown in reverse or the same order as they were started. | true | boolean
| *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.startupRecorder* | 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). | | 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
diff --git
a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 54422a9..0a29ac0 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -474,11 +474,13 @@ public abstract class BaseMainSupport extends BaseService
{
mainConfigurationProperties.setStartupRecorderMaxDepth(Integer.parseInt(value.toString()));
}
- if ("false".equals(mainConfigurationProperties.getStartupRecorder())) {
+ if ("off".equals(mainConfigurationProperties.getStartupRecorder())
+ ||
"false".equals(mainConfigurationProperties.getStartupRecorder())) {
camelContext.adapt(ExtendedCamelContext.class).getStartupStepRecorder().setEnabled(false);
} else if
("logging".equals(mainConfigurationProperties.getStartupRecorder())) {
camelContext.adapt(ExtendedCamelContext.class).setStartupStepRecorder(new
LoggingStartupStepRecorder());
- } else if
("java-flight-recorder".equals(mainConfigurationProperties.getStartupRecorder())
+ } else if
("jfr".equals(mainConfigurationProperties.getStartupRecorder())
+ ||
"java-flight-recorder".equals(mainConfigurationProperties.getStartupRecorder())
|| mainConfigurationProperties.getStartupRecorder() == null) {
// try to auto discover camel-jfr to use
StartupStepRecorder fr =
camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
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 dfff669..320588f 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
@@ -108,6 +108,7 @@ public abstract class DefaultConfigurationProperties<T> {
private long routeControllerBackOffMaxAttempts;
private double routeControllerBackOffMultiplier;
private boolean routeControllerUnhealthyOnExhausted;
+ @Metadata(enums = "false,off,java-flight-recorder,jfr,logging")
private String startupRecorder;
private int startupRecorderMaxDepth = -1;
private boolean startupRecorderRecording;
@@ -1147,10 +1148,8 @@ public abstract class DefaultConfigurationProperties<T> {
}
/**
- * 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.
+ * 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).
*/
public void setStartupRecorder(String startupRecorder) {
this.startupRecorder = startupRecorder;
@@ -1985,8 +1984,8 @@ public abstract class DefaultConfigurationProperties<T> {
}
/**
- * To use startup recorder for capturing execution time during starting
Camel. The recorder can be one of: false,
- * logging, java-flight-recorder
+ * 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).
*
* The default is false.
*/